Sorting algorithms/Strand sort: Difference between revisions

m
→‎{{header|Perl 6}}: minor simplfications
m (→‎{{header|REXX}}: corrected a stray question mark. -- ~~~~)
m (→‎{{header|Perl 6}}: minor simplfications)
Line 790:
my $i = 0;
gather while $i < @x {
if @x[$i] !before $prev {
take $prev = splice(@x, $i, 1)[0];
}
else {
$i++;
}
else {
take $prev = splice(@x, $i, 1)[0];
}
}
Line 810:
say "After @a[]";
 
@a = <The quick brown fox jumps over the lazy dog's back.>;
say "Before @a[]";
@a = strand_sort(@a);
Line 817:
<pre>Before 1 20 64 72 48 75 96 55 42 74
After 1 20 42 48 55 64 72 74 75 96
Before The quick brown fox jumps over the lazy dog's back.
After The back. brown dog's fox jumps lazy over quick the</pre>
 
=={{header|PicoLisp}}==
Anonymous user