Rdis和JQuery一样是纯粹为应用而产生的,这里记录的是在CentOS 5.7上学习入门文章:1.Redis简介Redis是一个key-value存储系统。和Memcached类似,但是解决了断电后数据完全丢失的情况,而且她支持更多无化的value类型,除了和string外,还支持lists(链...
分类:
其他好文 时间:
2015-02-04 12:45:53
阅读次数:
148
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. 题目意思很简单....
分类:
其他好文 时间:
2015-02-04 12:41:16
阅读次数:
132
Merge k sorted linked lists and return it as one sorted list. Analyze and describe its complexity.
一开始我没有采用分治法,解题思路是:首先比较每条链表的第一个元素,找出最小的那个,插入新链表并从原链表删除,如此反复直至所有的链表都为空链表。基于这个愚蠢的解题思路,我的C++代码实现如下:
...
分类:
其他好文 时间:
2015-02-03 17:19:27
阅读次数:
158
思路:
好像是数据结构上面的原题,就不多说了,通过比较把两个链表一起就可以了。需要注意的就是两个链表的head谁当新表的head问题,当然谁小谁当head 了,先比较一下即可。...
分类:
其他好文 时间:
2015-02-03 13:25:52
阅读次数:
174
http://qqdenghaigui.iteye.com/blog/1554541一,带函数Pred1, all(Pred, List) -> boolean()如果List中的每个元素作为Pred函数的参数执行,结果都返回true,那么all函数返回true,否则返回false例子:lists:...
分类:
其他好文 时间:
2015-02-03 12:49:34
阅读次数:
224
Q:
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 ...
分类:
其他好文 时间:
2015-02-02 23:06:26
阅读次数:
153
Read the following lists:http://improve.dk/debugging-in-production-part-1-analyzing-100-cpu-usage-using-windbg/http://improve.dk/debugging-in-producti...
分类:
其他好文 时间:
2015-02-02 23:03:32
阅读次数:
141
Write a program to find the node at which the intersection of two singly linked lists begins.For example, the following two linked lists:A: a...
分类:
其他好文 时间:
2015-02-02 22:41:30
阅读次数:
141
原题地址先将A链末尾和B链头部接起来然后判断是否有环,如果无环,说明肯定不想交,如果有环,那么相交的位置就是环开始的位置第一遍做的时候没遇到什么问题,第二遍做的时候各种出错,后来发现原来在用快慢指针法的时候快慢指针要从起点开始,否则计算出来的第一个相交位置不是环开始的位置。。代码: 1 ListNo...
分类:
其他好文 时间:
2015-02-02 19:42:17
阅读次数:
165
最近发现一个ets和list的查找小问题,以前一直没有注意,问题是这样的,一样的数据在list中能够查到,但是在ets中查不到:
从上图可以看出,对于list中可以使用2.0找到2,但是在ets中却不行,说明lists中查找使用的是==而ets中使用的是=:=,虽然不是什么特别严重问题,但是可能会在代码中留下难以发现的bug...
分类:
其他好文 时间:
2015-02-01 21:55:09
阅读次数:
232