(i) Combinations. Write a program that, given two non-negative integers n and r with 0 ≤ r ≤ n, generates all subsets of cardinality r of {1,2,...,n}. Include a printout of various test cases.
(2) Permutations. Write a program that, given two non-negative integers n and r with 0 < r < n, generates all lists of length r (without repetitions) of {1,2,...,n}. Include a printout of various test cases.