Exam weight Low
Exam weight
High
- AVL property: for every node, the heights of its two children differ by at most 1.
🎯 How this can come up · 1 question
MCQ
An AVL tree requires that for every node, the children’s heights differ by at most:
Correct: 1.
Exam weight Low
Exam weight Low
Exam weight Low
- Height of an AVL tree with n nodes is O(log n).
Exam weight Low
Exam weight Low
Exam weight Low
Exam weight Low
- Trinode restructuring: take the unbalanced node z, its taller child y and grandchild x; make the middle one the root of the subtree.
Exam weight Low
Exam weight Low
- Single rotation when x, y, z are in a straight line (LL or RR).
Exam weight Low
Exam weight Low
Exam weight Low
Exam weight
High
- Double rotation when they zig-zag (LR or RL).
🎯 How this can come up · 1 question
MCQ
An imbalance caused by inserting into the right subtree of a node’s left child needs a:
Correct: Double rotation.
Exam weight Low
Exam weight Low
Exam weight Low
Exam weight Low
Exam weight Low
Exam weight
High
- Search, insert and remove are all O(log n) in an AVL tree.
🎯 How this can come up · 1 question
MCQ
Worst-case search in an AVL tree with n nodes:
Correct: O(log n).
Exam weight Low
Exam weight Low
Exam weight Low
Exam weight Low
Exam weight Low
Exam weight Low
No slides match this filter.