一.redis 环境搭建1.简介 redis是一个开源的key-value数据库。它又经常被认为是一个数据结构服务器。因为它的value不仅包括基本的string类型还有 list,set ,sorted set和hash类型。当然这些类型的元素也都是string类型。也就是说list,set这些集...
分类:
其他好文 时间:
2015-03-11 19:00:43
阅读次数:
300
https://leetcode.com/problems/find-minimum-in-rotated-sorted-array-ii/Follow upfor "Find Minimum in Rotated Sorted Array":What ifduplicatesare allowed...
分类:
其他好文 时间:
2015-03-11 16:28:55
阅读次数:
121
欢迎大家阅读参考,如有错误或疑问请留言纠正,谢谢
154 Find Minimum in Rotated Sorted Array II
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 ...
分类:
其他好文 时间:
2015-03-11 14:57:45
阅读次数:
135
//两个指针从后往前扫一遍就行void merge(int A[], int m, int B[], int n) { int i = m-1,j = n - 1 ,k = m+n-1; while(i>=0&&j>=0){ if(A[i]>B[j]) A[k--] = A...
分类:
其他好文 时间:
2015-03-11 14:37:53
阅读次数:
115
Given a sorted linked list, delete all nodes that have duplicate numbers, leaving only distinct numbers from the original list.For example, Given 1->2...
分类:
其他好文 时间:
2015-03-11 14:29:17
阅读次数:
111
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-03-11 12:21:34
阅读次数:
193
Search for a Range
Total
Accepted: 36248 Total
Submissions: 130885
Given a sorted array of integers, find the starting and ending position of a given target value.
Your algorithm's runti...
分类:
其他好文 时间:
2015-03-11 10:51:13
阅读次数:
143
Given a sorted array, remove the duplicates in place such that each element appear onlyonceand return the new length.Do not allocate extra space for a...
分类:
编程语言 时间:
2015-03-11 10:40:39
阅读次数:
123
Given a set of non-overlapping intervals, insert a new interval into the intervals (merge if necessary).
You may assume that the intervals were initially sorted according to their start times.
Examp...
分类:
其他好文 时间:
2015-03-10 21:27:41
阅读次数:
134
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...
分类:
其他好文 时间:
2015-03-10 17:11:55
阅读次数:
122