Problem
1. Outline, but do not implement, a recursive solution for generating all subsets of the set {1, 2, . . . , n}.
2. Exercise an iterative way of generating all permutations of the sequence (0, 1, . . . , n - 1). Explain why the algorithm produces the correct result.