153. Find Minimum in Rotated Sorted Array 二分题目,由于rotated存在,a[mid]<key不能判断在哪一边搜索。 可以根据a[low]与a[high]的关系,来判断哪一边有序,哪一边存在rotate,进而缩小搜索区间。 开区间写法:(由于搜索区间和解区 ...
分类:
其他好文 时间:
2018-11-08 01:16:42
阅读次数:
213
https://leetcode.com/problems/merge-sorted-array/description/ Given two sorted integer arrays nums1 and nums2, merge nums2 into nums1 as one sorted ar ...
分类:
其他好文 时间:
2018-11-07 19:54:56
阅读次数:
144
附: 127.0.0.1:6379> set xiaofei 小飞 OK 127.0.0.1:6379> get xiaofei "\xe5\xb0\x8f\xe9\xa3\x9e" 127.0.0.1:6379> quit [root@localhost redis-2.8.6]# redisc ...
分类:
其他好文 时间:
2018-11-07 00:51:13
阅读次数:
236
内置函数知识点二 lamda匿名函数 sorted() filter() map() 递归函数 lamda 怎么使用 #计算n的n次方 普通的函数写 def func(n): return n**n print(func(10)) 一, lamda匿名函数 为了解决一些简单的需求而设计的一句话函数 ...
分类:
编程语言 时间:
2018-11-06 19:25:47
阅读次数:
217
基本的数据类型 二进制安全的字符串 Lists: 按插入顺序排序的字符串元素的集合。他们基本上就是链表(linked lists)。 Sets: 不重复且无序的字符串元素的集合。 Sorted sets,类似Sets,但是每个字符串元素都关联到一个叫score浮动数值(floating number ...
分类:
其他好文 时间:
2018-11-06 13:32:40
阅读次数:
119
You are given two integer arrays nums1 and nums2 sorted in ascending order and an integer k. Define a pair (u,v) which consists of one element from th... ...
分类:
其他好文 时间:
2018-11-06 11:22:59
阅读次数:
191
Given a n x n matrix where each of the rows and columns are sorted in ascending order, find the kth smallest element in the matrix. Note that it is th... ...
分类:
其他好文 时间:
2018-11-06 11:16:38
阅读次数:
156
There are two sorted arrays nums1 and nums2 of size m and n respectively. Find the median of the two sorted arrays. The overall run time complexity sh ...
分类:
其他好文 时间:
2018-11-06 01:01:10
阅读次数:
207
生活里没有奇迹,大部分的时候奇迹是你自己创造的。# # # sum = lambda a,b:a+b# svm = sum(10,510)# print(svm)# st = ["魔兽世界","吃鸡","阴阳师","地下城与勇士","传奇","王者农药"]# s1 = lambda st:len(s ...
分类:
其他好文 时间:
2018-11-05 22:52:30
阅读次数:
304
https://leetcode.com/problems/search-insert-position/description/ Given a sorted array and a target value, return the index if the target is found. If ...
分类:
其他好文 时间:
2018-11-05 13:36:23
阅读次数:
157