Sorting algorithms/Permutation sort: Difference between revisions

Content added Content deleted
m (→‎{{header|Phix}}: added syntax colouring the hard way)
(→‎RcppAlgos: Commented on an alternative loop.)
Line 2,052: Line 2,052:
> permuSort(test)
> permuSort(test)
[1] 1 2 3 4 5 6 7 8 9 10</pre>
[1] 1 2 3 4 5 6 7 8 9 10</pre>

An alternative solution would be to replace the while loop with the following:
<lang r>repeat
{
if(!is.unsorted(iter$nextIter())) break
}</lang>
This seems more explicit than the empty while loop, but also more complex.


=={{header|Racket}}==
=={{header|Racket}}==