Search Insert PositionGiven 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 ...
分类:
其他好文 时间:
2014-11-22 13:17:11
阅读次数:
164
Follow up for "Find Minimum in Rotated Sorted Array":What if duplicates are allowed?Would this affect the run-time complexity? How and why?前面那道题:Find ...
分类:
其他好文 时间:
2014-11-22 11:59:28
阅读次数:
162
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).Find the minimum element.Yo...
分类:
其他好文 时间:
2014-11-22 11:53:59
阅读次数:
149
Follow up for "Find Minimum in Rotated Sorted Array":What if duplicates are allowed?Would this affect the run-time complexity? How and why?Suppose a s...
分类:
其他好文 时间:
2014-11-22 07:03:46
阅读次数:
206
Merge k sorted linked lists and return it as one sorted list. Analyze and describe its complexity.Have you met this question in a real interview?Analy...
分类:
其他好文 时间:
2014-11-22 07:03:11
阅读次数:
192
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).Find the minimum element.Yo...
分类:
其他好文 时间:
2014-11-22 07:02:08
阅读次数:
190
合并两个有序数组,放在A中,A中的空间足够。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 th...
分类:
其他好文 时间:
2014-11-22 01:56:43
阅读次数:
209
1 class Solution { 2 public: 3 int removeDuplicates(int A[], int n) { 4 int *s=&A[0],*e=&A[0]; //s指向开头第一个,e往后遍历相同的 5 int t,i,j=n; 6 fo...
分类:
编程语言 时间:
2014-11-22 00:40:25
阅读次数:
215
A fast method to determine the number is odd or even:total & 0x1 //true, if total is oddtotal & 0x1 //false, if total is evenProblem StatementThere ar...
分类:
其他好文 时间:
2014-11-21 20:28:27
阅读次数:
151
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 valu...
分类:
其他好文 时间:
2014-11-21 12:06:48
阅读次数:
197