Convert Sorted List to Binary Search TreeGiven a singly linked list where elements are sorted in ascending order, convert it to a height balanced BST....
分类:
其他好文 时间:
2014-08-16 12:19:20
阅读次数:
227
Given two sorted integer arrays A and B, merge B into A as one sorted array.
Note:
You may assume that A has enough space (size that is greater or equal to m + n) to hold additional elements fro...
分类:
其他好文 时间:
2014-08-16 11:12:43
阅读次数:
317
1.NSArray 是一个父类,NSMUtableArray是其子类,他们构成了OC的数组。2.NSArray的创建NSArray * array = [[NSArray alloc]initWithObjects:@"one",@"two",@"three",@"four good",nil];/...
分类:
其他好文 时间:
2014-08-16 01:01:09
阅读次数:
209
A - 一二三Time Limit:1000MS Memory Limit:65535KB 64bit IO Format:%I64d & %I64uSubmitStatusDescription你弟弟刚刚学会写英语的一(one)、二(two)和三(three)。他在纸上写了好些一二...
分类:
其他好文 时间:
2014-08-16 00:59:19
阅读次数:
203
本题需要使用选择矩阵的程序求解,这个和Leetcode上的一个程序是一样道理的。如果使用额外空间,那么是很容易做到的,这里不使用额外空间,直接使用到位操作,空间效率是O(1),这是个非常漂亮的到位旋转程序。
题意还是很重要,这次看错了一句话,就WA了一次:
The maximum amount of cells which contains two equal numbers after ov...
分类:
其他好文 时间:
2014-08-15 22:35:29
阅读次数:
288
1306. Sequence Median
Time limit: 1.0 second
Memory limit: 1 MB
Language limit: C, C++, Pascal
Given a sequence of N nonnegative integers. Let's define the median of such sequence. If N is...
分类:
其他好文 时间:
2014-08-15 21:13:00
阅读次数:
247
过去已无法改变,未来又难以琢磨,我们只能把握当下[问题描述]Given two sorted integer arrays A and B, merge B into A as one sorted array.Note:You may assume that A has enough space ...
分类:
其他好文 时间:
2014-08-15 21:02:49
阅读次数:
165
Recover Binary Search Tree
Two elements of a binary search tree (BST) are swapped by mistake.
Recover the tree without changing its structure.
Note:
A solution using O(n)
space is pretty s...
分类:
其他好文 时间:
2014-08-15 19:39:39
阅读次数:
222
题目:
Given two sorted integer arrays A and B, merge B into A as one sorted array.
Note:
You may assume that A has enough space to hold additional elements from B. The number of elements initia...
分类:
其他好文 时间:
2014-08-15 18:00:09
阅读次数:
194
Let's play a game
Time Limit: 2 Seconds Memory Limit: 65536 KB
Elves from the Lothvain forest have created a very interesting game. The rules are very simple:
There are two players.
...
分类:
其他好文 时间:
2014-08-15 17:56:19
阅读次数:
251