abc_begin

导航

上一页 1 ··· 16 17 18 19 20

2017年9月17日 #

88. Merge Sorted Array【easy】

摘要: 88. Merge Sorted Array【easy】 Given two sorted integer arrays nums1 and nums2, merge nums2 into nums1 as one sorted array. Note:You may assume that num 阅读全文

posted @ 2017-09-17 22:12 LastBattle 阅读(165) 评论(0) 推荐(0) 编辑

605. Can Place Flowers【easy】

摘要: 605. Can Place Flowers【easy】 Suppose you have a long flowerbed in which some of the plots are planted and some are not. However, flowers cannot be pla 阅读全文

posted @ 2017-09-17 19:35 LastBattle 阅读(197) 评论(0) 推荐(0) 编辑

485. Max Consecutive Ones【easy】

摘要: 485. Max Consecutive Ones【easy】 Given a binary array, find the maximum number of consecutive 1s in this array. Example 1: Input: [1,1,0,1,1,1] Output: 阅读全文

posted @ 2017-09-17 18:49 LastBattle 阅读(110) 评论(0) 推荐(0) 编辑

448. Find All Numbers Disappeared in an Array【easy】

摘要: 448. Find All Numbers Disappeared in an Array【easy】 Given an array of integers where 1 ≤ a[i] ≤ n (n = size of array), some elements appear twice and 阅读全文

posted @ 2017-09-17 18:30 LastBattle 阅读(164) 评论(0) 推荐(0) 编辑

1. Two Sum【easy】

摘要: 1. Two Sum【easy】 Given an array of integers, return indices of the two numbers such that they add up to a specific target. You may assume that each in 阅读全文

posted @ 2017-09-17 16:36 LastBattle 阅读(137) 评论(0) 推荐(0) 编辑

189. Rotate Array【easy】

摘要: 189. Rotate Array【easy】 Rotate an array of n elements to the right by k steps. For example, with n = 7 and k = 3, the array [1,2,3,4,5,6,7] is rotated 阅读全文

posted @ 2017-09-17 16:21 LastBattle 阅读(166) 评论(0) 推荐(0) 编辑

redis源码学习_字典

摘要: redis中字典有以下要点: (1)它就是一个键值对,对于hash冲突的处理采用了头插法的链式存储来解决。 (2)对rehash,扩展就是取第一个大于等于used * 2的2 ^ n的数作为新的hash表大小;缩紧就是取第一个大于等于used的2 ^ n的数作为新的hash表大小。后面会介绍到dic 阅读全文

posted @ 2017-09-17 13:50 LastBattle 阅读(488) 评论(0) 推荐(0) 编辑

2017年9月16日 #

redis源码学习_整数集合

摘要: redis里面的整数集合保存的都是整数,有int_16、int_32和int_64这3种类型,和C++中的set容器差不多。 同时具备如下特点: 1、set里面的数不重复,均为唯一。 2、set里面的数是从小到大有序的,这在后面的intsetAdd函数中可以看到。 然后由于a56爆大奖在线娱乐们可以同时存储int_1 阅读全文

posted @ 2017-09-16 22:57 LastBattle 阅读(820) 评论(1) 推荐(0) 编辑

redis源码学习_链表

摘要: redis的链表是双向链表,该链表不带头结点,具体如下: 主要总结一下adlist.c和adlist.h里面的关键结构体和函数。 链表节点结构如下: 链表结构如下: 链表迭代器的结构如下: 里面涉及的函数中,增、删的比较简单,就是结构里面没有带头结点,a56爆大奖在线娱乐需要单独判断一下头结点的特殊情况。另外对于尾 阅读全文

posted @ 2017-09-16 21:29 LastBattle 阅读(206) 评论(0) 推荐(0) 编辑

redis源码学习_简单动态字符串

摘要: SDS相比传统C语言的字符串有以下好处: (1)空间预分配和惰性释放,这就可以减少内存重新分配的次数 (2)O(1)的时间复杂度获取字符串的长度 (3)二进制安全 主要总结一下sds.c和sds.h中的关键函数 1、sdsmapchars 2、sdstrim 3、sdsll2str 4、sdsspl 阅读全文

posted @ 2017-09-16 12:32 LastBattle 阅读(627) 评论(1) 推荐(0) 编辑

上一页 1 ··· 16 17 18 19 20