摘要:
There are N gas stations along a circular route, where the amount of gas at station i is gas[i]. You have a car with an unlimited gas tank and it cost 阅读全文
摘要:
The thief has found himself a new place for his thievery again. There is only one entrance to this area, called the "root." Besides the root, each hou 阅读全文
摘要:
Given inorder and postorder traversal of a tree, construct the binary tree. Note:You may assume that duplicates do not exist in the tree. Hide Company 阅读全文
摘要:
Given a non-empty binary search tree and a target value, find k values in the BST that are closest to the target. Note: Given target value is a floati 阅读全文
摘要:
Given a non-empty binary search tree and a target value, find the value in the BST that is closest to the target. Note: Given target value is a floati 阅读全文
摘要:
Given a binary tree, find its minimum depth. The minimum depth is the number of nodes along the shortest path from the root node down to the nearest l 阅读全文
摘要:
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 l 阅读全文
摘要:
Find the sum of all left leaves in a given binary tree. Example: 3 / \ 9 20 / \ 15 7 There are two left leaves in the binary tree, with values 9 and 1 阅读全文
摘要:
Given a binary tree, count the number of uni-value subtrees. A Uni-value subtree means all nodes of the subtree have the same value. For example:Given 阅读全文
摘要:
Given a binary tree, find the length of the longest consecutive sequence path. The path refers to any sequence of nodes from some starting node to any 阅读全文