Previous Up Next

5.10.3  Next permutation: nextperm

The nextperm takes as argument a permutation.
nextperm returns the next permutation in lexicographic order, or undef if there is no next permutation.
Input:

prevperm([0,2,3,1])

Output:

[0,2,1,3]

Previous Up Next