Treap - randomized BST + max-heap on priorities
Insert, search, and delete integer keys while a randomized priority keeps the binary search tree balanced in expectation. The tree preserves BST order by key and max-heap order by priority, using rotations to restore heap order after updates.
O(log n) because random priorities simulate a random BST.
Treaps split balancing work across two fields: key determines search order, priority determines shape. That separation makes rotations easy to explain visually.
Insert/search/delete are expected O(log n). The same rotation primitives as AVL and red-black trees appear here, but the balancing rule is probabilistic instead of deterministic.