3.2) Minimum Depth of Binary Tree

Given a binary tree, find the minimum depth of the tree. The minimum depth is defined as the minimum distance from the root node to the nearest leaf node. A…

1.3) Binary Tree Zigzag Level Order Traversal

Given the root of a binary tree, return the zigzag level order traversal of its nodes' values. Zigzag level order traversal means visiting all nodes at each level alternatively from…

1.1) Binary Tree Level Order Traversal

Given the root of a binary tree, return the level order traversal of its nodes' values. Level order traversal means visiting all nodes at each level from left to right…

2.9) Find All The Lonely Nodes

Given the root of a binary tree, a lonely node is a node that has no siblings (i.e., it's the only child of its parent). Return an array containing the…

Binary Tree Inorder Traversal

Given the root of a binary tree, return the inorder traversal of its nodes' values. In inorder traversal, we visit the left subtree first, then the current node, and finally…

Range Sum of BST

Given the root of a binary search tree (BST), and integers low and high, find the sum of all node values in the BST that are within the range .

2.7) Diameter of Binary Tree

Given a binary tree, find the length of the longest path between any two nodes in the tree. This path may or may not pass through the root.

Sum Root to Leaf Numbers

Given a binary tree, where each node has a value between 0 and 9, find the total sum of all root-to-leaf numbers. A root-to-leaf number is a number represented by…

Binary Tree Maximum Path Sum

Given a binary tree, find the maximum path sum. The maximum path sum is defined as the maximum sum of any path from any node to any node in the…

3.1) Maximum Depth of Binary Tree

Given a binary tree, find its maximum depth. The maximum depth is the number of nodes along the longest path from the root node down to the farthest leaf node.