Trees easy time O(h) space O(1)
BST — Insert
A binary search tree keeps everything smaller than a node in its left subtree and everything larger in its right. Inserting means walking down that rule until you fall off the tree, then hanging the new node there.
Build a binary search tree: smaller keys go left, larger go right.
1 / 19
Practice
Machine twin: /dsa-viz-v2/bst-insert.json — the full deterministic run as structured data.