Describe a nonrecursive algorithm for enumerating all permutations of the numbers {1, 2, ... , n} using an explicit stack.