Greetings, everyone. I'm sure all of you know that we can obtain permutations of something using C++ STL's next_permutation() function. However...
There are cases in which we do need to obtain all permutations, but not necessarily in lexicographical order. So I thought: "If that's the case, then the next_permutation() function does more work than I really need it to".
So here's the question I have to ask everyone: what is the most efficient non-lexicographical permutation algorithm?