题目
Given a binary tree, return the bottom-up level order traversal of its nodes' values. (ie, from left to right, level by level from leaf to root).
For example:
Given binary tree {3,9,20,#,#...
分类:
其他好文 时间:
2014-12-19 17:30:36
阅读次数:
172
题目
Given a binary tree, return the level order traversal of its nodes' values. (ie, from left to right, level by level).
For example:
Given binary tree {3,9,20,#,#,15,7},
3
/ ...
分类:
其他好文 时间:
2014-12-19 17:30:08
阅读次数:
167
Given a binary tree, return the inorder traversal of its nodes' values.
For example:
Given binary tree {1,#,2,3},
1
2
/
3
return [1,3,2].
Note: Recursive solutio...
分类:
其他好文 时间:
2014-12-19 12:17:50
阅读次数:
147
错误提示:Debugging
information for "project.exe" cannot be found or does not match. Binary was not built with debug information.
Solution:
To enable debugging:
1) Goto Project->Properties
2)...
分类:
其他好文 时间:
2014-12-19 12:15:39
阅读次数:
263
Given a binary tree, return the preorder traversal of its nodes' values.
For example:
Given binary tree {1,#,2,3},
1
2
/
3
return [1,2,3].
Note: Recursive soluti...
分类:
其他好文 时间:
2014-12-19 12:14:35
阅读次数:
118
这题要收费了。只能网上看题目,我等屌丝也没法OJ测试了。网上看了后发现其实并非独创,其他的方也有类似的题。例如在这里,CareerCup上先用了递归的想法, TreeNode *ans; TreeNode *helper156(TreeNode *root) { if...
分类:
其他好文 时间:
2014-12-19 12:05:48
阅读次数:
167
Q:Given a sorted array of integers, find the starting and ending position of a given target value.
Your algorithm's runtime complexity must be in the order of O(log n).
If the target is not foun...
分类:
其他好文 时间:
2014-12-19 10:08:58
阅读次数:
174
1 package com.java7.showbitsdemo; 2 /* 3 * Try This 5-3 4 * A class that displays the binary representation of a value. 5 */ 6 class ShowBits { 7 ...
分类:
其他好文 时间:
2014-12-19 00:34:17
阅读次数:
290
Two elements of a binary search tree (BST) are swapped by mistake.Recover the tree without changing its structure.Note:A solution using O(n) space is ...
分类:
其他好文 时间:
2014-12-19 00:21:29
阅读次数:
174
Binary Tree Maximum Path SumGiven a binary tree, find the maximum path sum.The path may start and end at any node in the tree.For example:Given the be...
分类:
其他好文 时间:
2014-12-18 23:37:42
阅读次数:
417