Jump to content

Sorting algorithms/Permutation sort: Difference between revisions

→‎RcppAlgos: Commented on an alternative loop.
m (→‎{{header|Phix}}: added syntax colouring the hard way)
(→‎RcppAlgos: Commented on an alternative loop.)
Line 2,052:
> permuSort(test)
[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}}==
331

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.