[leetcode]Remove Duplicates from Sorted List...
分类:
其他好文 时间:
2014-09-15 11:23:08
阅读次数:
126
[leetcode]Remove Duplicates from Sorted List II...
分类:
其他好文 时间:
2014-09-15 11:22:01
阅读次数:
192
Merge Two Sorted Lists: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 fi...
分类:
编程语言 时间:
2014-09-15 01:02:17
阅读次数:
269
Given a sorted array and a target value, return the index if the target is found. If not, return the index where it would be if it were inserted in order.
You may assume no duplicates in the array....
分类:
其他好文 时间:
2014-09-14 22:10:17
阅读次数:
146
设两个数组分别为A和B,size为as和bs。原问题可以转化为两个排序数组求第k大的问题。
还是两种思路:
比较A[as/2]和B[bs/2],每次抛弃A或者B的一半
代码如下:
double findMedianSortedArrays(int A[], int m, int B[], int n) {
int total = m + n;
if (tot...
分类:
其他好文 时间:
2014-09-14 12:53:37
阅读次数:
170
1 /***************************************************************** 2 created: 2014/09/13 16:16 3 filename: remove-duplicates-from-sorted-arra...
分类:
其他好文 时间:
2014-09-13 22:43:46
阅读次数:
192
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. 1 /** 2 ...
分类:
其他好文 时间:
2014-09-13 20:03:15
阅读次数:
228
Given a sorted linked list, delete all duplicates such that each element appear onlyonce.For example,Given1->1->2, return1->2.Given1->1->2->3->3, retu...
分类:
其他好文 时间:
2014-09-13 20:01:15
阅读次数:
205
Given a sorted array and a target value, return the index if the target is found. If not, return the index where it would be if it were inserted in or...
分类:
其他好文 时间:
2014-09-13 20:01:05
阅读次数:
176
Suppose a sorted array is rotated at some pivot unknown to you beforehand.
(i.e., 0 1 2 4 5 6 7 might become 4
5 6 7 0 1 2).
You are given a target value to search. If found in the array retur...
分类:
其他好文 时间:
2014-09-12 00:01:02
阅读次数:
254