摘要:
How to systematically generate all the permutations of a given sequence?seehttp://en.wikipedia.org/wiki/Next_permutation1, Find the largest index k such that a[k] < a[k + 1]. If no such index exists, the permutation is the last permutation.2, Find the largest index l such that a[k] < a[l]. Sin 阅读全文