Redis 在新浪微博中的应用Redis简介1. 支持5种数据结构支持strings, hashes, lists, sets, sorted setsstring是很好的存储方式,用来做计数存储。sets用于建立索引库非常棒;2. K-V 存储 vs K-V 缓存新浪微博目前使用的98%都是持久化...
分类:
其他好文 时间:
2015-01-27 18:02:41
阅读次数:
202
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.思路分析:这题是 LeetCode Sort List需要使用的merge两个有序链表使得结果仍然有序这个子过程,详细...
分类:
其他好文 时间:
2015-01-27 15:05:13
阅读次数:
134
Given two sorted integer arrays A and B, merge B into A as one sorted array.Note:You may assume that A has enough space (size that is greater or equal to m + n) to hold additional elements from B. The...
分类:
其他好文 时间:
2015-01-27 14:57:01
阅读次数:
149
原题链接:https://oj.leetcode.com/problems/merge-two-sorted-lists/
这道题用指针的指针实现,做法会非常简单干净。直接上代码
/**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
*...
分类:
其他好文 时间:
2015-01-27 14:56:08
阅读次数:
109
通常,合并分支时,如果可能,Git会用Fast forward模式,但这种模式下,删除分支后,会丢掉分支信息。如果要强制禁用Fast forward模式,Git就会在merge时生成一个新的commit,这样,从分支历史上就可以看出分支信息。下面我们实战一下--no-ff方式的git merge:首...
分类:
其他好文 时间:
2015-01-27 12:35:51
阅读次数:
193
You are given two linked lists representing two non-negative numbers. The digits are stored in reverse order and each of their nodes contain a single digit. Add the two numbers and return it as a link...
分类:
其他好文 时间:
2015-01-27 09:29:46
阅读次数:
186
# -*- coding: utf8 -*-'''__author__ = 'dabay.wang@gmail.com'21: Merge Two Sorted Listshttps://oj.leetcode.com/problems/merge-two-sorted-lists/Merge tw...
分类:
编程语言 时间:
2015-01-27 07:03:06
阅读次数:
681
Intersection of Two Linked ListsWrite a program to find the node at which the intersection of two singly linked lists begins.For example, the followin...
分类:
其他好文 时间:
2015-01-27 00:29:31
阅读次数:
215
Merge Two Sorted ListsMerge two sorted linked lists and return it as a new list. The new list should be made by splicing together the nodes of the fir...
分类:
其他好文 时间:
2015-01-27 00:26:06
阅读次数:
204
题目:两个数组A、B,长度分别为m、n,即A(m)、B(n),分别是递增数组。求第K大的数字。方法一:简单的办法,使用Merge Sort,首先将两个数组合并,然后在枚举查找。这个算法的时间复杂度是O(m+n)、空间复杂度也是O(M+n)。这个方法其实没有考虑到有第K大数为两个相同数字的情况。方法二...
分类:
编程语言 时间:
2015-01-26 22:25:57
阅读次数:
295