码迷,mamicode.com
首页 >  
搜索关键字:sorted    ( 5925个结果
Search Insert Position
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
Leetcode: Find Minimum in Rotated Sorted Array II
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
Leetcode: Find Minimum in Rotated Sorted Array
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
Leetcode-Find Minimum in Rotated Sorted Array II
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
Leetcode-Merge k Sorted Lists
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
Leetcode-Find Minimum in Rotated Sorted Array
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
leetcode[89] Merge Sorted Array
合并两个有序数组,放在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
LeetCode Remove Duplicates from Sorted Array删除整型数组中的重复元素并返回剩下元素个数
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
Median of Two Sorted Arrays
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
Leetcode-Search in Rotated Sorted Array
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
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!