Sort disjoint sublist: Difference between revisions

Content added Content deleted
imported>Chinhouse
(Added Easylang)
Line 1,730: Line 1,730:
[7 0 5 4 3 2 1 6]
[7 0 5 4 3 2 1 6]
Elapsed Time: 0.626 ms.</pre>
Elapsed Time: 0.626 ms.</pre>

=={{header|EasyLang}}==
<syntaxhighlight>
val[] = [ 7 6 5 4 3 2 1 0 ]
ind[] = [ 7 2 8 ]
#
for i = 1 to len ind[] - 1
for j = i + 1 to len ind[]
if ind[j] < ind[i]
swap ind[j] ind[i]
.
.
.
for i = 1 to len ind[] - 1
for j = i + 1 to len ind[]
if val[ind[j]] < val[ind[i]]
swap val[ind[j]] val[ind[i]]
.
.
.
print val[]
</syntaxhighlight>


=={{header|EchoLisp}}==
=={{header|EchoLisp}}==