AVL Trees, Binary Heaps & Hashing Probe Complexity
Minimum nodes in AVL tree of height h, O(n) Build-Heap proof, and LL/RR/LR/RL rotation rules.
Binary Heap Index Formulas (0-based vs 1-based)
| Convention | Root | Left Child of | Right Child of | Parent of |
|---|---|---|---|---|
| 1-Based Array | ||||
| 0-Based Array |
Finding Maximum in a Min-Heap: In a Min-Heap of distinct elements, the maximum element MUST reside in one of the leaf nodes, so finding it requires comparisons in the worst case!
AVL Rotations Summary
- Single Rotation (1 rotation): Triggered by outer insertion LL (Right Rotate) or RR (Left Rotate).
- Double Rotation (2 rotations): Triggered by zig-zag inner insertion LR (Left then Right) or RL (Right then Left).
- In AVL insertion, fixing the lowest imbalanced ancestor restores balance to the entire tree ( rotations!). In AVL deletion, rotations may propagate up to the root ( rotations).
Practice Questions on This Chapter (6)
What is the tight worst-case time complexity of building a Binary Max-Heap bottom-up (Build-Max-Heap) from an unsorted array of elements?
What is the minimum number of nodes in an height-balanced AVL tree of height (where a single root node has height )?
Which open-addressing collision resolution technique eliminates both primary and secondary clustering?
What is the minimum number of nodes in a height-balanced AVL tree of height (where a single root node has height )?
Keys 12, 18, 13, 2, 3, 23, 5, 15 are inserted in order into an initially empty hash table of size using and Linear Probing. At which index is key 15 placed?
In a Binary Max-Heap containing distinct elements stored in a 1-indexed array H[1..100], in which subarray index range MUST the minimum element reside?