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
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
我们需要对List进行排序,Python提供了两个方法 对给定的List L进行排序, 方法1.用List的成员函数sort进行排序 方法2.用built-in函数sorted进行排序(从2.4开始) --------------------------------sorted------...
分类:
编程语言 时间:
2015-01-09 17:39:06
阅读次数:
196
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
题目:
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
这是本人在研究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
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
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
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
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