Given a binary tree, return the tilt of the whole tree. The tilt of a tree node is defined as the absolute difference between the sum of all left subt ...
分类:
其他好文 时间:
2017-10-22 21:46:34
阅读次数:
165
Given a binary search tree and the lowest and highest boundaries as L and R, trim the tree so that all its elements lies in [L, R] (R >= L). You might ...
分类:
其他好文 时间:
2017-10-22 21:42:12
阅读次数:
103
Given a non-empty binary tree, return the average value of the nodes on each level in the form of an array. Example 1: ...
分类:
其他好文 时间:
2017-10-22 21:27:55
阅读次数:
91
Given a binary tree, find the length of the longest path where each node in the path has the same value. This path may or may not pass through the roo ...
分类:
其他好文 时间:
2017-10-22 21:20:42
阅读次数:
101
Given two non-empty binary trees s and t, check whether tree t has exactly the same structure and node values with a subtree of s. A subtree of s is a ...
分类:
其他好文 时间:
2017-10-22 21:16:30
阅读次数:
150
Given a Binary Search Tree and a target number, return true if there exist two elements in the BST such that their sum is equal to the given target. E ...
分类:
其他好文 时间:
2017-10-22 20:57:06
阅读次数:
124
Given a binary tree, return the level order traversal of its nodes' values. (ie, from left to right, level by level). Example Given binary tree {3,9,2 ...
分类:
其他好文 时间:
2017-10-22 11:11:41
阅读次数:
129
Find the sum of all left leaves in a given binary tree. Example: 方法二: ...
分类:
其他好文 时间:
2017-10-22 01:40:25
阅读次数:
164
Given a Binary Search Tree (BST), convert it to a Greater Tree such that every key of the original BST is changed to the original key plus sum of all ...
分类:
其他好文 时间:
2017-10-22 00:34:43
阅读次数:
118
Given a binary search tree (BST), find the lowest common ancestor (LCA) of two given nodes in the BST. According to the definition of LCA on Wikipedia ...
分类:
其他好文 时间:
2017-10-22 00:32:00
阅读次数:
143