|
| 1 | +1. Suppose u and v both denote sets in Python. What is the most general condition that guarantees that u - (v - u) == u? |
| 2 | + The sets u and v should be disjoint. |
| 3 | + The set v should be a subset of the set u. |
| 4 | + The set u should be a subset of the set v. |
| 5 | + This is true for any u and v. |
| 6 | + |
| 7 | +This is true for any u and v. |
| 8 | + |
| 9 | +2. Suppose u and v both denote sets in Python. What is the most general condition that guarantees that u|v == u^v? |
| 10 | + The sets u and v should be disjoint. |
| 11 | + The set u should be a subset of the set v. |
| 12 | + The set v should be a subset of the set u. |
| 13 | + This is true for any u and v. |
| 14 | + |
| 15 | +The sets u and v should be disjoint. |
| 16 | + |
| 17 | +3. Suppose we insert 19 into the min heap [17,25,42,67,38,89,54,98,89]. What is the resulting heap? |
| 18 | + |
| 19 | +[17,19,42,67,25,89,54,98,89,38] |
| 20 | + |
| 21 | +4. Suppose we execute delete-min twice on the min-heap [13,29,24,67,52,89,45,98.79,58]. What is the resulting heap? |
| 22 | + |
| 23 | +[29,52,45,67,79,89,58,98] |
0 commit comments