2 ms·
I'd love feedback from anyone who reads it :)
by mcochrane 4y ago
I'd love feedback from anyone who reads it :)
- muth02446 4y agoIf you generate permutations in lexicographic order one at a time, you only need to change suffix of the previous permutation which should be faster than O(n * n!) This paper by Rainer Kemp has investigates the complexity: https://link.springer.com/article/10.1007/s002360050114 https://link.springer.com/article/10.1007/s002360050114