A Binary Search Tree is a tree where every node satisfies one rule: all values in the left subtree are strictly smaller, and all values in the right subtree are strictly larger. This ordering property is what makes search, insert, and delete all run in O(log n) average time on a balanced tree.
At every node you make one binary decision — go left or go right — eliminating the other half of the tree entirely. With n nodes and a balanced tree you need at most log₂(n) comparisons to find anything. That is 20 comparisons for a million nodes, versus a million for a linear scan.
Compare the target with the current node. Equal — found. Smaller — go left (all values there are smaller). Larger — go right (all values there are larger). Each comparison eliminates an entire subtree.
Run the same comparison path as search until you reach a null slot. Place the new node there. The BST property is automatically satisfied — no restructuring needed because every comparison guarantees correct placement.
Leaf: remove directly. One child: bypass the node by connecting parent to child. Two children: find the in-order successor (smallest value in the right subtree), copy its value here, delete the successor — which has at most one child.
Inserting already-sorted values creates a degenerate tree — a linked list. All operations become O(n). Self-balancing variants (AVL, Red-Black) prevent this by rotating after each operation, guaranteeing O(log n) always.
TIPWatch the DELETE case for node 20 carefully — it has two children (10 and 30), which triggers the in-order successor case. The animation finds 25 (leftmost of the right subtree), copies 25 to node 20's position, then deletes the original 25 node. Step through slowly to see why this preserves BST order.