题目:Remove Duplicates from Sorted ListGiven a sorted linked list, delete all duplicates such that each element appear onlyonce.For example,Given1->1->2...
分类:
其他好文 时间:
2014-07-10 14:29:45
阅读次数:
259
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-07-10 12:37:21
阅读次数:
189
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.
分类:
其他好文 时间:
2014-07-10 00:18:17
阅读次数:
278
Given a sorted linked list, delete all nodes that have duplicate numbers, leaving only distinct numbers from the original list.For example,Given 1->2-...
分类:
其他好文 时间:
2014-07-07 16:17:00
阅读次数:
139
题目:Merge Two Sorted ListsMerge two sorted linked lists and return it as a new list. The new list should be made by splicing together the nodes of the ...
分类:
其他好文 时间:
2014-07-07 14:06:19
阅读次数:
221
Follow up for "Search in Rotated Sorted Array":What if duplicates are allowed?
分类:
其他好文 时间:
2014-07-07 13:07:00
阅读次数:
153
Follow up for "Remove Duplicates":What if duplicates are allowed at most twice?
分类:
其他好文 时间:
2014-07-03 11:51:05
阅读次数:
117
Given a sorted linked list, delete all duplicates such that each element appear only once.
分类:
其他好文 时间:
2014-07-02 00:33:49
阅读次数:
204
var indexOfSorted = function f(arr,n){
//assume : arr has been sorted
var low = 0;
var high = arr.length - 1;
var mid = (low + high) / 2;
while(high - low > 1){
if(n == arr[low]){return low...
分类:
Web程序 时间:
2014-06-30 08:54:10
阅读次数:
978
题目
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 O(log (m+n)).
方法
转换为寻找第k大的数。
...
分类:
其他好文 时间:
2014-06-30 06:05:58
阅读次数:
261