Visualize binary search trees, node path traversals, element insertions, and structural node deletions.
Where h is the height of the tree. In a balanced BST, h = O(log N). In a skewed tree, it degrades to O(N).
Takes O(h) space due to recursion stack frames. Can be optimized to O(1) space if implemented iteratively.
Node search(Node root, int key) {if (root == null || root.key == key)
return root;
if (key < root.key)
return search(root.left, key);
return search(root.right, key);
}