Permutations/Rank of a permutation: Difference between revisions

Line 1,546:
next
func nextPermutation (a)
elementcount = len(a)
if elementcount < 1 then return ok
Line 1,565:
permutationReverse(a, pos+1, elementcount)
func permutationReverse (a, first, last)
while first < last
temp = a[first]
2,468

edits