码迷,mamicode.com
首页 >  
搜索关键字:sorted    ( 5925个结果
[LeetCode]153 Find Minimum in Rotated Sorted Array
https://oj.leetcode.com/problems/find-minimum-in-rotated-sorted-array/http://blog.csdn.net/linhuanmars/article/details/40449295publicclassSolution{ publicintfindMin(int[]num){ //Assumenumisnotnull. returnfind(num,0,num.length-1); } privateintfind(int[]n,in..
分类:其他好文   时间:2015-01-09 19:35:03    阅读次数:179
[LeetCode]154 Find Minimum in Rotated Sorted Array II
https://oj.leetcode.com/problems/find-minimum-in-rotated-sorted-array-ii/http://blog.csdn.net/linhuanmars/article/details/40449299publicclassSolution{ publicintfindMin(int[]num){ //SolutionA: //returnfindMin_Iteration(num); //SolutionB: returnfindMin_Recu..
分类:其他好文   时间:2015-01-09 19:34:31    阅读次数:165
python sorted
我们需要对List进行排序,Python提供了两个方法 对给定的List L进行排序, 方法1.用List的成员函数sort进行排序 方法2.用built-in函数sorted进行排序(从2.4开始) --------------------------------sorted------...
分类:编程语言   时间:2015-01-09 17:39:06    阅读次数:196
Remove Duplicates from Sorted Array II
Follow up for "Remove Duplicates":What if duplicates are allowed at mosttwice?For example,Given sorted array A =[1,1,1,2,2,3],Your function should ret...
分类:其他好文   时间:2015-01-09 15:27:07    阅读次数:142
[C++]LeetCode: 80 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. You may assume no duplicate exi...
分类:编程语言   时间:2015-01-09 12:42:03    阅读次数:253
good article————K’th Smallest/Largest Element in Unsorted Array | Set 2 (Expected Linear Time)
这是本人在研究leetcode中Median of Two Sorted Arrays一题目的时候看到一篇文章,觉得非常好,其中对快速排序重新实现。 文章来源于http://www.geeksforgeeks.org/这个网站。 We recommend to read following post as a prerequisite of this post. K’th Sma...
分类:其他好文   时间:2015-01-09 10:45:54    阅读次数:189
LeetCode--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 first two lists. Solutions: /** * Definition for singly-linked list. ...
分类:其他好文   时间:2015-01-09 09:16:56    阅读次数:160
LeetCode--Merge k Sorted Lists
Merge k sorted linked lists and return it as one sorted list. Analyze and describe its complexity. /** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *ne...
分类:其他好文   时间:2015-01-09 09:16:33    阅读次数:136
LeetCode-Search for a Range
Given a sorted array of integers, find the starting and ending position of a given target value Your algorithm's runtime complexity must be in the order of O(log n). If the target is not found i...
分类:其他好文   时间:2015-01-08 22:51:15    阅读次数:254
[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 7might become4 5 6 7 0 1 2).Find the minimum element.You m...
分类:其他好文   时间:2015-01-08 12:56:21    阅读次数:112
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!