【题目】
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
Partition ListGiven a linked list and a valuex,
partition it such that all nodes less thanxcome before nodes greater than or
equal tox.You should pres...
分类:
其他好文 时间:
2014-06-07 06:24:57
阅读次数:
179
Today is the last day that all the laptops of
winXP OS should be upgrade to WIN7. After updated. when i tried to debug my
application,i received this ...
分类:
其他好文 时间:
2014-06-06 15:51:14
阅读次数:
275
Given an array of integers, find two numbers
such that they add up to a specific target number.The function twoSum should
return indices of the two nu...
分类:
其他好文 时间:
2014-06-05 14:15:07
阅读次数:
221
一。介绍public abstract void invalidateDrawable
(Drawable who)Called when the drawable needs to be redrawn. A view at this point
should invalidate itself ...
分类:
其他好文 时间:
2014-06-05 14:13:44
阅读次数:
218
Given a linked list, swap every two adjacent
nodes and return its head.For example,Given1->2->3->4, you should
return the list as2->1->4->3.Your algor...
分类:
其他好文 时间:
2014-06-05 13:41:44
阅读次数:
231
题意:对数列有三种操作:
Print operation l,?r. Picks should write down the value of .
Modulo operation l,?r,?x. Picks should perform assignment a[i]?=?a[i] mod x for
each i (l?≤?i?≤?r).
Set operation k...
分类:
其他好文 时间:
2014-06-02 02:56:56
阅读次数:
465
【题目】
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.
1 3 3 2 1
\ / / / \ ...
分类:
其他好文 时间:
2014-06-01 15:33:45
阅读次数:
297
Given a linked list, reverse the nodes of a linked list k at a time and return its modified list.
If the number of nodes is not a multiple of k then left-out nodes in the end should remain as it is...
分类:
其他好文 时间:
2014-06-01 09:05:42
阅读次数:
271