Merge two sorted linked lists and return it as
a new list. The new list should be made by splicing together the nodes of the
first two lists./** * Def...
分类:
其他好文 时间:
2014-06-11 22:56:31
阅读次数:
257
1 /* 2 Design and implement a data structure
for Least Recently Used (LRU) cache. It should support the following operations:
get and set. 3 ...
分类:
其他好文 时间:
2014-06-11 13:08:46
阅读次数:
297
/验证规则详细配置 public function rules() { // NOTE: you
should only define rules for those attributes that // will receive user inputs.
...
分类:
其他好文 时间:
2014-06-11 10:05:03
阅读次数:
180
题目
Given n, generate all structurally unique BST's (binary search trees) that store values 1...n.
For example,
Given n = 3, your program should return all 5 unique BST's shown below.
...
分类:
其他好文 时间:
2014-06-08 15:15:26
阅读次数:
223
Single NumberGiven an array of integers, every
element appearstwiceexcept for one. Find that single one.Note:Your algorithm
should have a linear runti...
分类:
其他好文 时间:
2014-06-07 23:44:39
阅读次数:
302
题目:Given a linked list and a valuex, partition it
such that all nodes less thanxcome before nodes greater than or equal tox.You
should preserve the or...
分类:
其他好文 时间:
2014-06-07 20:35:55
阅读次数:
236
A basic requirement is that the function should
provide a uniform distribution of hash values. A non-uniform distribution
increases the number of coll...
分类:
其他好文 时间:
2014-06-07 16:58:29
阅读次数:
240
The expression after ELSE should have the same type as those after THEN: "bigint" is expected but "i...
分类:
其他好文 时间:
2014-06-07 15:41:57
阅读次数:
412
【题目】
Given a binary tree
struct TreeLinkNode {
TreeLinkNode *left;
TreeLinkNode *right;
TreeLinkNode *next;
}
Populate each next pointer to point to its next right node. If there is no next right node, the next pointer should be...
分类:
其他好文 时间:
2014-06-07 14:28:36
阅读次数:
215
【题目】
Given a binary tree, flatten it to a linked list in-place.
For example,
Given
1
/ 2 5
/ \ 3 4 6
The flattened tree should look like:
1
2
3
4
\...
分类:
其他好文 时间:
2014-06-07 11:37:00
阅读次数:
153