问题描述:
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:
...
分类:
其他好文 时间:
2015-01-14 22:54:05
阅读次数:
158
Question: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 t...
分类:
编程语言 时间:
2015-01-14 19:44:13
阅读次数:
323
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.为了方便表头处理,...
分类:
其他好文 时间:
2015-01-14 17:54:36
阅读次数:
242
题目:
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 ...
分类:
编程语言 时间:
2015-01-14 16:58:27
阅读次数:
222
Alex D James 7 May 2009 3:44 PM One of the most common questions we get is how long should an ObjectContext should live. Options often cited include o...
分类:
其他好文 时间:
2015-01-14 14:08:49
阅读次数:
232
Implement regular expression matching with support for '.' and '*'.
'.' Matches any single character.
'*' Matches zero or more of the preceding element.
The matching should cover the entire input st...
分类:
其他好文 时间:
2015-01-14 12:50:05
阅读次数:
162
题目Merge Two Sorted Lists通过率33.2%难度EasyMerge two sorted linked lists and return it as a new list. The new list should be made by splicing together the ...
分类:
其他好文 时间:
2015-01-14 12:30:19
阅读次数:
159
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 ...
分类:
其他好文 时间:
2015-01-14 09:52:27
阅读次数:
150
There are two sorted arrays A and B of size m and n respectively. Find the median of the two sorted arrays. The overall run time complexity should be ...
分类:
其他好文 时间:
2015-01-14 00:42:38
阅读次数:
278
【题目】
Given an unsorted integer array, find the first missing positive integer.
For example,
Given [1,2,0] return 3,
and [3,4,-1,1] return 2.
Your algorithm should run in O(n) time and use...
分类:
其他好文 时间:
2015-01-13 21:35:19
阅读次数:
197