Suppose a sorted array is rotated at some pivot unknown to you beforehand.(i.e.,0 1 2 4 5 6 7might become4 5 6 7 0 1 2).You are given a target value t...
分类:
其他好文 时间:
2014-11-16 07:06:34
阅读次数:
174
之前忘记记录这题了,现在补上。合并两个有序的list,要求是:Merge two sorted linked lists and return it as a new list. The new list should be made by splicing together the nodes o...
分类:
其他好文 时间:
2014-11-15 18:30:36
阅读次数:
169
Write an efficient algorithm that searches for a value in anmxnmatrix. This matrix has the following properties:Integers in each row are sorted from l...
分类:
其他好文 时间:
2014-11-15 18:23:59
阅读次数:
165
Similar with version I, but analysis is different. With the possibility of duplication, only ">" indicate a definite case of next search space.class S...
分类:
其他好文 时间:
2014-11-15 16:56:14
阅读次数:
201
There's usually a common strategy for "find *" problems - binary search: half the space can be dropped by some rules.And take care of corner cases.cla...
分类:
其他好文 时间:
2014-11-15 16:53:56
阅读次数:
171
Remove Duplicates from Sorted ArrayGiven a sorted array, remove the duplicates in place such that each element appear onlyonceand return the new lengt...
分类:
其他好文 时间:
2014-11-14 20:52:34
阅读次数:
154
Given a sorted array, remove the duplicates in place such that each element appear onlyonceand return the new length.Do not allocate extra space for a...
分类:
其他好文 时间:
2014-11-14 17:21:06
阅读次数:
250
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.C++代码如下:#...
分类:
其他好文 时间:
2014-11-14 17:13:09
阅读次数:
193
Remove Duplicates from Sorted ArrayGiven a sorted array, remove the duplicates in place such that each element appear only once and return the new len...
分类:
其他好文 时间:
2014-11-14 12:18:21
阅读次数:
89
Python中排序主要有两个函数:sorted和列表成员函数sort,两者除了调用方式有些区别外,最显著的区别是sorted会新建一个排序好的列表并返回,而sort是修改原列表并排好序。sorted的原型是:
sorted(iterable, cmp=None, key=None, reverse=False)
sort的原型是:
list.sort(cmp=None, key=None, ...
分类:
编程语言 时间:
2014-11-14 10:49:10
阅读次数:
225