Path Sum
Given the of a binary tree and an integer , return if the tree has a root-to-leaf path such that adding up all the values along the path equals .
A leaf is a node with no children.
Given the of a binary tree and an integer , return if the tree has a root-to-leaf path such that adding up all the values along the path equals .
A leaf is a node with no children.
Given a binary tree, determine if it is height-balanced
Example 1:
108. Convert Sorted Array to Binary Search Tree
Given an integer array where the elements are sorted in ascending order, convert it to a
height-balanced binary search tree.
104.Maximum Depth of Binary Tree
Given the of a binary tree, return its maximum depth.
A binary tree’s maximum depth is the number of nodes along the longest path from the root node down to the farthest leaf node.
Given the of a binary tree, check whether it is a mirror of itself (i.e., symmetric around its center).
Example 1:
Given the roots of two binary trees and , write a function to check if they are the same or not.
Two binary trees are considered the same if they are structurally identical, and the nodes have the same value.
94.Binary Tree In order Traversal
Given the of a binary tree, return the in order traversal of its nodes’ values.
Example 1:
You are given two integer arrays and , sorted in non-decreasing order, and two integers and , representing the number of elements in and respectively.
Merge and into a single array sorted in non-decreasing order.