⚡ AlgoZen_
~/home/trees_&_bst/dfs_(inorder)3 / 3

DFS (Inorder)

Intermediate

Depth-First Search visits each subtree completely before backtracking. Inorder (L→Root→R) on a BST produces sorted output. Preorder is used for tree serialization.

time:O(n)
space:O(h) — tree height
⚡ +200_XP
step[1/18]
> Start
1245367
DFS Inorder traversal: Left → Root → Right. On a BST this gives sorted order.

// tap NEXT STEP to walk through one step at a time