Given a binary tree, imagine yourself standing on the right side of it, return the values of the nodes you can see ordered from top to bottom.
For example:
Given the following binary tree,
1 ...
分类:
其他好文 时间:
2015-04-06 14:17:43
阅读次数:
104
【题目】
Given a binary tree, imagine yourself standing on the right side of it, return the values of the nodes you can see ordered from top to bottom.
For example:
Given the following binary tre...
分类:
其他好文 时间:
2015-04-06 11:32:47
阅读次数:
173
题目:An AVL tree is a self-balancing binary search tree. In an AVL tree, the heights of the two child subtrees of any node differ by at most one; if at ...
分类:
其他好文 时间:
2015-04-06 11:15:43
阅读次数:
148
Given a binary tree, imagine yourself standing on therightside of it, return the values of the nodes you can see ordered from top to bottom.For exampl...
分类:
其他好文 时间:
2015-04-06 06:27:07
阅读次数:
103
Pre x goodness of a set string is length of longest common pre x*number of strings in the set. For
example the pre x goodness of the set f000,001,0011g is 6.You are given a set of binary strings. Fin...
分类:
其他好文 时间:
2015-04-06 01:07:22
阅读次数:
178
Given a binary tree containing digits from0-9only, each root-to-leaf path could represent a number.An example is the root-to-leaf path1->2->3which rep...
分类:
其他好文 时间:
2015-04-06 00:54:29
阅读次数:
189
题目链接:https://leetcode.com/problems/binary-tree-preorder-traversal/(非递归实现)二叉树的先序遍历。 1 class Solution 2 { 3 public: 4 vector preorderTraversal(TreeN...
分类:
其他好文 时间:
2015-04-05 23:31:23
阅读次数:
144
题目链接:https://leetcode.com/problems/binary-tree-inorder-traversal/(非递归实现)二叉树的中序遍历。 1 class Solution 2 { 3 public: 4 vector inorderTraversal(TreeNod...
分类:
其他好文 时间:
2015-04-05 23:29:30
阅读次数:
149
题目链接:https://leetcode.com/problems/unique-binary-search-trees/从最简单的情况开始考虑:n = 0 :只有“空树”这一种情况。f[0]= 1。n = 1 :只有“根节点”这一种情况。f[1]= 1。n = 2 :由于“根节点”必须存在,所以...
分类:
其他好文 时间:
2015-04-05 23:28:47
阅读次数:
171