3D Data Structures · No. 1

AVL Mobile

A self-balancing binary search tree, hung as a mobile. After G. Adelson-Velsky & E. Landis, 1962.

AVL Mobile
Insert · delete · search in O(log n)
Selected node
Height
Balance
Subtree size
Depth

How to read the mobile

Each disc is a node and its number is the value. Smaller values hang to the left, larger to the right, so reading the discs from left to right gives the sorted order.

The badge is the balance factor: the height of the left subtree minus the height of the right. Each arm tilts toward the taller side.

Cobalt is the value being inserted, searched or deleted, and the wires it has followed. When a node reaches ±2, the tree rotates: the link between two nodes turns about its middle like a see-saw, and the red disc drops back into balance.

Drag to orbit · scroll or pinch to zoom · right-drag or two fingers to pan · click a disc to inspect it.
Space play or pause · ← → step · Enter insert · ? this card