Operations are applied to both trees. Duplicate values are ignored. In the AVL tree, each node maintains a balance factor in the range −1 to +1.
Enter a value and choose Insert or Remove.
AVL Tree
Self-balancing BSTWhat to observe
BST: insertion order can produce a skewed tree. Its height can become linear in the number of nodes.
AVL: after insertion and deletion, rotations restore the balance condition. Its height remains logarithmic in the number of nodes.
Balance factor: height(left subtree) − height(right subtree). The small number shown below each AVL node is its balance factor.
Operation history
- Both trees are empty.