Permutations/Rank of a permutation: Difference between revisions
Permutations/Rank of a permutation (view source)
Revision as of 17:52, 21 October 2017
, 6 years ago→{{header|Ring}}
Line 1,546:
next
func nextPermutation
elementcount = len(a)
if elementcount < 1 then return ok
Line 1,565:
permutationReverse(a, pos+1, elementcount)
func permutationReverse
while first < last
temp = a[first]
|