Question: 2. Questions 2a-2b are about the backtracking algorithm MAKE-SETS, written in Cormen's pseudocode. The parameter s is a set of nonnegative integers. The parameters n,

2. Questions 2a-2b are about the backtracking algorithm MAKE-SETS, written in Cormen's pseudocode. The parameter s is a set of nonnegative integers. The parameters n, k, and e are nonnegative integers. The symbol ' is the empty set, the operator U' is set union, and the operatoris set subtraction. MAKE-SETS(n, k) MAKING-SETS(, n, k, 1) MAKING-SETS(S, n, k, e) if k == 0 prints else for e' = e ton s=su{e} MAKING-SETS(s, n, k-1, e'+ 1) s=s-e'} 2a. (5 points.) What will MAKE-SETS(4, 2) print? Hint: enumerate a tree of recursive calls to MAKING-SETS, breadth-first, and look for a pattern. 2b. (5 points.) Let n and k be nonnegative integers. What does MAKE-SETSn, k) compute? Your answer must be one short sentence, stated in terms of n and k
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
