We consider producing permutations and combinations in lexicographical order. Except for the array that holds the combinatorial object, we require only O(1) extra storage. The production of the next item requires O(1) amortized time.
Permutations; combinations; amortized complexity