Sorting algorithms/Permutation sort: Difference between revisions
Sorting algorithms/Permutation sort (view source)
Revision as of 19:56, 26 October 2015
, 8 years ago→{{header|Sidef}}: code simplifications
(Added EchoLisp) |
m (→{{header|Sidef}}: code simplifications) |
||
Line 1,388:
=={{header|Sidef}}==
{{trans|Perl}}
<lang ruby>func psort(x, d=x.end) {
range(1, x.end).each { |i|
x[i] < x[i-1] && return false
}
return true;
);
Line 1,401:
x[d] < x[d-1] && next;
psort(x, d-1) && return true;
}
return false;
|