Apex › Storage & databases

AVL tree

A binary search tree that rebalances itself after every insert via rotations, so it never degrades into a linked list. Insert keys (or 7 sorted ones) and watch the balance factors and rotations keep it log-deep.

More in Storage & databases