Rotation

Swap a node and its parent.

Fix links to the kids to maintain the binary-search-tree property.

HW: Write pseudocode.

Running time in terms of the height of the tree?

What happens to the depths of nodes?


next up previous
Next: Nearly Balanced Trees Up: ROTATIONS Previous: Recovering from Bad Luck