Question: Thanks! 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

 Thanks! 2. Questions 2a-2b are about the backtracking algorithm MAKE-SETS, written

Thanks!

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 operator is 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-SETS(n, k) compute? Your answer must be one short sentence, stated in terms of n and k. 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 operator is 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-SETS(n, 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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!