← PATTERN ATLAS
PATTERN 07 · 11 PROBLEMS

Trees & recursive traversal

Ask what one subtree returns, then combine the left and right answers.

Start the first lesson ↗
MASTER KEYDefine the meaning of one recursive return value.
0OF 11
RECALLED
RECOGNITION SIGNAL

Each node’s answer depends only on inverted child subtrees.

01
Not started

Invert Binary Tree

Each node’s answer depends only on inverted child subtrees.

↗
02
Not started

Maximum Depth of Binary Tree

A node’s depth is one plus the deeper child depth.

↗
03
Not started

Same Tree

Both corresponding nodes must agree before their children can agree.

↗
04
Not started

Subtree of Another Tree

Every source node is a possible root; equality is a separate recursive question.

↗
05
Not started

Lowest Common Ancestor of a Binary Search Tree

BST ordering shows when both targets lie on the same side.

↗
06
Not started

Binary Tree Level Order Traversal

A queue boundary separates the current level from the next.

↗
07
Not started

Validate Binary Search Tree

Each ancestor contributes a lower or upper bound, not just the parent.

↗
08
Not started

Kth Smallest Element in a BST

In-order traversal visits BST values in ascending order.

↗
09
Not started

Construct Binary Tree from Preorder and Inorder Traversal

Preorder chooses the root; inorder splits left and right subtrees.

↗
10
Not started

Binary Tree Maximum Path Sum

A parent can extend at most one child branch, while the global answer may join two.

↗
11
Not started

Serialize and Deserialize Binary Tree

Null markers make traversal shape unambiguous.

↗