Sorting algorithms/Permutation sort: Difference between revisions

Faster D entry
(Improved D entry)
(Faster D entry)
Line 346:
 
void permutationSort(T)(T[] items) /*pure nothrow*/ {
foreach (perm; permutations!false(items))
if (isSorted(perm)) {
items[] = perm;