
An algorithm for generating all permutations with time complexity better than O(n!*n) or at least with better constant than while using next_permutation function? Wikipedia doesn't know anything about this, so it's quite amazing. I suppose you could just leave a comment to my recipe with this algorithm's description, and if it is really correct, it will be counted as your nonzero contribution. 