【题目】
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:...
分类:
其他好文 时间:
2014-11-23 17:35:12
阅读次数:
131
问题描述:
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 uses con...
分类:
其他好文 时间:
2014-11-23 16:02:15
阅读次数:
211
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...
分类:
其他好文 时间:
2014-11-23 09:25:10
阅读次数:
174
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-11-23 01:50:55
阅读次数:
150
Choosing number
Time Limit: 2 Seconds
Memory Limit: 65536 KB
There are n people standing in a row. And There are m numbers, 1.2...m. Every one should choose a number. But if two persons ...
分类:
其他好文 时间:
2014-11-22 14:44:25
阅读次数:
142
The most precious thingis life.Lifefor each person only once.Therefore,people's life should be spent this way:when a personlook back at the past,not b...
分类:
其他好文 时间:
2014-11-21 21:48:42
阅读次数:
185
直方图均衡化 —— 其潜在的数学原理是一个分布(输入的亮度直方图)被映射到另一个分布 其目的是拉伸原始图像直方图,增强其对比度 To accomplish the equalization effect, the remapping should be the cumulative distribu...
分类:
其他好文 时间:
2014-11-21 18:36:44
阅读次数:
282
LRU CacheDesign and implement a data structure for Least Recently Used (LRU) cache. It should support the following operations:getandset.get(key)- Get...
分类:
系统相关 时间:
2014-11-21 18:21:45
阅读次数:
238
Swap Nodes in PairsGiven a linked list, swap every two adjacent nodes and return its head.For example,Given1->2->3->4, you should return the list as2-...
分类:
其他好文 时间:
2014-11-21 18:16:43
阅读次数:
271
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-11-21 15:57:41
阅读次数:
227