Sorting algorithms/Strand sort: Difference between revisions
Content added Content deleted
(Racket version) |
(→{{header|Perl 6}}: minor shortening: factoring take) |
||
Line 810: | Line 810: | ||
gather { |
gather { |
||
while @x and @y { |
while @x and @y { |
||
given @x[0] cmp @y[0] { |
take do given @x[0] cmp @y[0] { |
||
when Increase { |
when Increase { @x.shift } |
||
when Decrease { |
when Decrease { @y.shift } |
||
when Same { |
when Same { @x.shift, @y.shift } |
||
} |
} |
||
} |
} |