Explanation
Binary Tree Inorder Traversal is a Easy interview problem tagged [Stack, Tree, DFS]. The winning approach is typically **Tree**.
#94
Given the root of a binary tree, return the inorder traversal of its nodes' values.
Example 1
Input: root = [1,null,2,3]
Output: [1,3,2]
Left → node → right order.
Example 2
Input: root = []
Output: []
Empty tree.
Example 3
Input: root = [1]
Output: [1]
Single node.
Binary Tree Inorder Traversal is a Easy interview problem tagged [Stack, Tree, DFS]. The winning approach is typically **Tree**.
Tree problems factor into identical subproblems on subtrees.
Recurse on left/right (DFS) or process level-by-level with a queue (BFS).
Pattern-level skeleton only — not this problem’s exact answer. Adapt it to the statement.
Time: O(n)
Space: O(1)
Before coding, restate the problem, name the pattern (Tree), and write the invariant or DP state in one sentence.
Got it?
Mark #94 Binary Tree Inorder Traversal as understood when the pattern clicks.