Almost Sorted ArrayTime Limit: 4000/2000 MS (Java/Others) Memory Limit: 262144/262144 K (Java/Others)Total Submission(s): 9982 Accepted Submission(s):... ...
分类:
其他好文 时间:
2019-07-24 22:54:00
阅读次数:
206
给定两个大小为 m 和 n 的有序数组 nums1 和 nums2。 请你找出这两个有序数组的中位数,并且要求算法的时间复杂度为 O(log(m + n))。 你可以假设 nums1 和 nums2 不会同时为空。 示例 1: nums1 = [1, 3] nums2 = [2] 则中位数是 2.0 ...
分类:
编程语言 时间:
2019-07-23 17:15:36
阅读次数:
109
一、redis最适合的场景 1 会话缓存(session cache) 2 全页缓存(FPC) 3 队列 4 排行榜/计数器 5 发布订阅二、Redis 的数据结构有五种,分别是: String——字符串 Hash——字典 List——列表 Set——集合 Sorted Set——有序集合三、red ...
分类:
其他好文 时间:
2019-07-22 13:07:03
阅读次数:
96
Given an array of integers A sorted in non-decreasing order, return an array of the squares of each number, also in sorted non-decreasing order. Examp ...
分类:
其他好文 时间:
2019-07-19 14:04:51
阅读次数:
100
sort 与 sorted 区别: 一、基本形式 列表有自己的sort方法,其对列表进行原址排序,既然是原址排序,那显然元组不可能拥有这种方法,因为元组是不可修改的。 排序,数字、字符串按照ASCII,中文按照unicode从小到大排序。 如果需要一个排序好的副本,代码如下: 另一种获取已排序的列表 ...
分类:
编程语言 时间:
2019-07-19 12:36:18
阅读次数:
124
题目描述 Given a sorted positive integer array nums and an integer n, add/patch elements to the array such that any number in range [1, n] inclusive can b ...
分类:
其他好文 时间:
2019-07-17 11:04:26
阅读次数:
87
参考博客:https://www.cnblogs.com/cxxjohnson/p/9072383.html ...
分类:
其他好文 时间:
2019-07-17 09:43:32
阅读次数:
105
Redis 数据类型 Redis支持五种数据类型:string(字符串),hash(哈希),list(列表),set(集合)及zset(sorted set:有序集合)。 String(字符串) string 是 redis 最基本的类型,你可以理解成与 Memcached 一模一样的类型,一个 k ...
分类:
其他好文 时间:
2019-07-16 20:19:05
阅读次数:
129
举个简单的例子,平常我们的函数是下面这种: def add(x,y): return x + y print(add(5,8)) 其实单纯的匿名函数很好理解,其中的关键字就是 lambda ,把上面的例子用匿名函数来写就是这样子 add = lambda x, y: x+y print(add(5, ...
分类:
其他好文 时间:
2019-07-10 16:37:05
阅读次数:
72