/** * Definition for a binary tree node. * struct TreeNode { * int val; * struct TreeNode *left; * struct TreeNode *right; * }; */#define ...
分类:
其他好文 时间:
2015-06-10 14:08:26
阅读次数:
100
转自:http://computer.uoh.edu.cn/mysql/1677.htmlMYSQL中STRING支持类型有:CHAR、VARCHAR、TINYTEXT、TEXT、MEDIUMTEXT、LONGTEXT、BINARY、VARBINARY、TINYBLOG、MEDIUMBLOG、BLO...
分类:
数据库 时间:
2015-06-10 13:50:47
阅读次数:
171
Validate Binary Search TreeGiven a binary tree, determine if it is a valid binary search tree (BST).Assume a BST is defined as follows:The left subtre...
分类:
其他好文 时间:
2015-06-10 12:03:48
阅读次数:
89
Given a binary tree, find the maximum path sum.The path may start and end at any node in the tree.For example:Given the below binary tree, 1 ...
分类:
其他好文 时间:
2015-06-10 12:03:48
阅读次数:
88
Follow up for problem "Populating Next Right Pointers in Each Node".What if the given tree could be any binary tree? Would your previous solution stil...
分类:
其他好文 时间:
2015-06-10 11:45:22
阅读次数:
101
Given a binary tree, flatten it to a linked list in-place.For example,Given 1 / \ 2 5 / \ \ 3 4 6The flattened t...
分类:
其他好文 时间:
2015-06-10 07:41:49
阅读次数:
105
超简洁的代码本来考虑是不是真的要每个点求一个maxDepth,看来是的哟public class Solution { public boolean isBalanced(TreeNode root) { if (root==null) return true; i...
分类:
其他好文 时间:
2015-06-10 06:35:56
阅读次数:
88
就recursive做,简单题public class Solution { public int minDepth(TreeNode root) { if(root==null) return 0; if (root.left==null && root.righ...
分类:
其他好文 时间:
2015-06-10 06:35:28
阅读次数:
138
Given an array where elements are sorted in ascending order, convert it to a height balanced BST.题解完全抄自ref的说明,感谢!“题解:先复习下什么是二叉搜索树(引自Wikipedia):二叉查找树(B...
分类:
其他好文 时间:
2015-06-10 06:33:38
阅读次数:
112
简单题IGiven a binary tree and a sum, determine if the tree has a root-to-leaf path such that adding up all the values along the path equals the given su...
分类:
其他好文 时间:
2015-06-10 06:33:31
阅读次数:
101