Visualize binary search trees, node path traversals, element insertions, and structural node deletions.
Every node in the tree is visited exactly once.
H is the height of the tree. The call stack grows with the depth of the recursion.
preOrder(node) {if (node == null) return;
visit(node);
preOrder(node.left);
preOrder(node.right);
}