18.6 Exercises
Factual
Consider the tree below. If we call
rotateLeft(C)
, which operation reverts the tree back to its original form?
When you rotate a nodes in a tree, which of the following can happen?
Procedural
Consider the following LLRB. What is the height of the corresponding 2-3 tree and how many 3-nodes does it have?
Suppose we insert
15
in the LLRB above. What is the first operation that must be applied to maintain the LLRB invariants?Suppose in the process of insertion, we end up with the following temporary 4-node. What is the corresponding LLRB representation of this node?
Metacognitive
Give a range of values, when inserted into the LLRB below, results in a
rotateRight
operation as the first balancing operation. Assume that values are distinct, but not necessarily integers.
Last updated