Givenn, how many structurally uniqueBST's(binary search trees) that store values 1...n?For example,Givenn= 3, there are a total of 5 unique BST's. 1.....
分类:
其他好文 时间:
2014-11-17 13:56:57
阅读次数:
141
题目描述:
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-11-17 12:26:22
阅读次数:
171
题目描述:
Given 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 sum.
For example:
Given the below binary tr...
分类:
其他好文 时间:
2014-11-17 10:48:34
阅读次数:
134
Given a singly linked list L: L0→L1→…→Ln-1→Ln,
reorder it to: L0→Ln→L1→Ln-1→L2→Ln-2→…
You must do this in-place without altering the nodes' values.
For example,
Given {1,2,3,4}, reorder itto {1,4,...
分类:
其他好文 时间:
2014-11-17 10:45:06
阅读次数:
179
1. 新增用户代码如下:mysql>insert into mysql.user(Host,User,Password) values("localhost","lionbule",password("hello1234"));mysql>flush privileges;2. 修改用户密码代码如下...
分类:
数据库 时间:
2014-11-17 10:23:22
阅读次数:
274
在Android适配方案小结(一)、(二)中,我们了解了一些基本概念。
那么在具体开发中,我们应该注意什么呢。
首先,我们必须要知道,其实适配的关键在于两点:
(1)不同分辨率设备的适配,这点在单位的使用上用dp、sp以及图片资源存放于不同的drawable文件夹就可以解决问题;
(2)不同尺寸的适配,这点主要靠将相关值以及布局文件放置于不同的文件夹中来解决。
2.1 values文件夹...
分类:
移动开发 时间:
2014-11-16 23:07:23
阅读次数:
222
Given a binary tree, return thezigzag level ordertraversal of its nodes' values. (ie, from left to right, then right to left for the next level and al...
分类:
其他好文 时间:
2014-11-16 18:36:32
阅读次数:
232
Given a singly linked listL:L0→L1→…→Ln-1→Ln,reorder it to:L0→Ln→L1→Ln-1→L2→Ln-2→…You must do this in-place without altering the nodes' values.For exam...
分类:
其他好文 时间:
2014-11-16 18:33:18
阅读次数:
200
Given a singly linked listL:L0→L1→…→Ln-1→Ln,reorder it to:L0→Ln→L1→Ln-1→L2→Ln-2→…You must do this in-place without altering the nodes' values.For exam...
分类:
其他好文 时间:
2014-11-16 14:41:01
阅读次数:
280
Given a binary tree, return thepreordertraversal of its nodes' values.For example:Given binary tree{1,#,2,3}, 1 \ 2 / 3return[1,2,3].二叉树...
分类:
其他好文 时间:
2014-11-16 13:23:07
阅读次数:
138