Question: Help needed for this question. Suppose that the symbol is the empty set, the symbol is the set union operator, and the symbol is
Help needed for this question.
Suppose that the symbol is the empty set, the symbol is the set union operator, and the symbol \ is the set subtraction operator. For example:
|
| = | |
| { 1, 2, 3 } | = | { 1, 2, 3 } |
| { 1, 2, 3 } | = | { 1, 2, 3 } |
| { 1, 2, 3 } { 4 } | = | { 1, 2, 3, 4 } |
| { 1, 2, 3 } { 2 } | = | { 1, 2, 3 } |
|
The backracking algorithm MAKE-SETS uses these set operators. It is written in Cormens pseudocode notation. The parameters n, k, and e are nonnegative integers. The parameter s is a set of nonnegative integers.
MAKE-SETS(n, k) MAKING-SETS(n, k, 1, ) MAKING-SETS(n, k, e, s) if k == 0 print s else for e = e to n s = s { e } MAKING-SETS(n, k1, e+ 1, s) s = s \ { e }
1. What sets will MAKE-SETS(4, 3) print? Hint: enumerate the recursive calls to MAKING-SETS breadth-first.
2. Let l and m be nonnegative integers. What does MAKE-SETS(l, m) compute? Your answer must be one short sentence, stated in terms of l and m.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
