NextPermutation

NextPermutation[p]
gives the permutation following p in lexicographic order.

更多信息更多信息