Given n, how many structurally unique BST's (binary search trees) that store values 1...n?
For example,
Given n = 3, there are a total of 5 unique BST's.
1 3 3 2 1
\ ...
分类:
其他好文 时间:
2015-06-24 16:23:28
阅读次数:
152
#58 Length of Last Word
Given a string s consists of upper/lower-case alphabets and empty space characters '
', return the length of last word in the string.
If the last word does not exist,...
分类:
其他好文 时间:
2015-06-24 16:22:21
阅读次数:
141
问题描述: 4 / \ 2 7 / \ / \1 3 6 9to 4 / \ 7 2 / \ / \9 6 3 1递归反转:先反转根节点的左子树和右子树 然后再分别反转左子树,右子树各自的下的左子树右子树。依此类推...
分类:
其他好文 时间:
2015-06-24 12:48:24
阅读次数:
111
非递归: public static int maxDepth(TreeNode root){ if(root==null) return 0; Queue q=new LinkedList(); q.offer(root); int enQu...
分类:
其他好文 时间:
2015-06-24 12:26:34
阅读次数:
98
nvert a binary tree. 4
/ \
2 7
/ \ / \
1 3 6 9
to
4
/ \
7 2
/ \ / \
9 6 3 1
Trivia:
This problem was inspired by this original tweet by Max Howell:
Goo...
分类:
其他好文 时间:
2015-06-24 00:49:49
阅读次数:
126
大牛没有能做出来的题,我们要好好做一做
Invert a binary tree.
4
/ 2 7
/ \ / 1 3 6 9
to
4
/ 7 2
/ \ / 9 6 3 1
Trivia:
This problem was inspired...
分类:
其他好文 时间:
2015-06-24 00:49:34
阅读次数:
169
4 / \ 2 7 / \ / \1 3 6 9 4 / \ 7 2 / \ / \9 6 3 1public class Solution { public TreeNode invertTree(TreeNode...
分类:
其他好文 时间:
2015-06-23 17:19:48
阅读次数:
101
Given a binary tree, determine if it is a valid binary search tree (BST).
Assume a BST is defined as follows:
The left subtree of a node contains only nodes with keys less than the node's key.Th...
分类:
其他好文 时间:
2015-06-23 15:50:51
阅读次数:
92
Given n, how many structurally unique BST's (binary search trees) that store values 1...n?
For example,
Given n = 3, there are a total of 5 unique BST's.
1 3 3 2 1
\ ...
分类:
其他好文 时间:
2015-06-23 15:43:19
阅读次数:
86
什么是blob,mysql blob大小配置介绍作者: 字体:[增加减小] 类型:转载BLOB (binary large object),二进制大对象,是一个可以存储二进制文件的容器。在计算机中,BLOB常常是数据库中用来存储二进制文件的字段类型BLOB是一个大文件,典型的BLOB是一张图片或一个...
分类:
数据库 时间:
2015-06-23 15:27:19
阅读次数:
147