Suryanand
Resources
Sky
Emerald
Database
Home
← All DSA topics
·
System design
Trees
20 problems in this topic. Select one to open the tabbed viewer.
Problems
1.
124. Binary Tree Maximum Path Sum
2.
297. Serialize and Deserialize Binary Tree — preorder with null markers.
3.
235. Lowest Common Ancestor of a BST
4.
236. Lowest Common Ancestor of a Binary Tree
5.
98. Validate BST
6.
230. Kth Smallest Element in a BST
7.
99. Recover Binary Search Tree — two swapped nodes, O(h) Morris optional; here O(n) inorder.
8.
103. Binary Tree Zigzag Level Order Traversal
9.
199. Binary Tree Right Side View
10.
114. Flatten Binary Tree to Linked List — preorder as right-skewed list.
11.
437. Path Sum III — paths starting anywhere, going down.
12.
337. House Robber III
13.
543. Diameter of Binary Tree — longest path edges between any two nodes.
14.
110. Balanced Binary Tree
15.
@param {import('../../lib/tree-node.js').TreeNode | null} a
16.
1448. Count Good Nodes in Binary Tree
17.
662. Maximum Width of Binary Tree — index BFS.
18.
105. Construct Binary Tree from Preorder and Inorder Traversal
19.
173. Binary Search Tree Iterator
20.
968. Binary Tree Cameras — minimum cameras to monitor all nodes.