First page Back Continue Last page Graphics
How much work does this require?
In all three cases (and the additional three mirror cases) The height of the tree after the rotations is the same as the height of the tree before the insertion was performed.
The work then is limited to:
- performing a single rotation at one node in the tree, or
- performing two rotations. The first at a node in the tree and the second at the parent node that is the target of the first rotation.