Tree Problems
Master trees by solving these carefully selected problems
Problems
104. Maximum Depth of Binary Tree
Given the `root` of a binary tree, return its maximum depth.
Easy
100. Same Tree
Given the roots of two binary trees `p` and `q`, write a function to check if they are the same or not.
Easy
102. Binary Tree Level Order Traversal
Given the `root` of a binary tree, return the level order traversal of its nodes' values. (i.e., from left to right, level by level).
Medium
98. Validate Binary Search Tree
Given the `root` of a binary tree, determine if it is a valid binary search tree (BST).
Medium
124. Binary Tree Maximum Path Sum
A path in a binary tree is a sequence of nodes where each pair of adjacent nodes in the sequence has an edge connecting them. A node can only appear in the sequence at most once. Note that the path does not need to pass through the root.
Hard