摘要:The Chubby lock service for loosely-coupled distributed systems http://research.google.com/archive/chubby-osdi06.pdf http://blog.sina.com.cn/s/blog_5eb8ebcb0101dkvj.html http://blog.csdn.net/histor...
阅读全文
摘要:Distributed Algorithms in NoSQL Databases, http://highlyscalable.wordpress.com/2012/09/18/distributed-algorithms-in-nosql-databases/ NOSQL Patterns, http://horicky.blogspot.com/2009/11/nosql-patterns...
阅读全文
摘要:A brief history of Consensus_ 2PC and Transaction Commit (译) 对于一致性问题很好的综述 Time Clocks and the Ordering of Events in a Distributed System(译) --Leslie Lamport 偏序和全序 Lamport的“Time, Clocks and th...
阅读全文
摘要:The Part-Time Parliament,Lamport,1998,ACM Transactions on Computer Systems. 晦涩的原文 http://research.microsoft.com/en-us/um/people/lamport/pubs/lamport-paxos.pdf Paxos Made Simple http://www.cs.utexas...
阅读全文
摘要:http://horicky.blogspot.com/2009/11/nosql-patterns.html A brief history of Consensus_ 2PC and Transaction Commit (译) 对于一致性问题很好的综述 2 Phase Commit(译) Master Slave (or Single Master)Model Under t...
阅读全文
摘要:http://highlyscalable.wordpress.com/2012/09/18/distributed-algorithms-in-nosql-databases/, Distributed Algorithms in NoSQL Databases http://www.cnblogs.com/chen77716/archive/2011/03/24/2130798.html...
阅读全文
摘要:主要参考, http://highlyscalable.wordpress.com/2012/09/18/distributed-algorithms-in-nosql-databases/, Distributed Algorithms in NoSQL Databases Data Consistency It is well known and fairly obvious...
阅读全文
摘要:MySQL索引背后的数据结构及算法原理, http://www.codinglabs.org/html/theory-of-mysql-index.html HBase Architecture, http://duanple.blog.163.com/blog/static/70971767201191661620641/ 数据库如何抵抗随机IO:问题、方法与现实, http://wangy...
阅读全文
摘要:通过实际例子来阐述vector clock其实是容易理解的, easy 同样通过实际例子来描述在使用vector clock时会遇到哪些难以解决的问题, hard Why Vector Clocks are Easy http://basho.com/blog/technical/2010/01/29/why-vector-clocks-are-easy/ Vector Clocks...
阅读全文
摘要:http://bitworking.org/news/380/bloom-filter-resourcesThe Bloom filter, conceived by Burton H. Bloom in 1970, is a space-efficient probabilistic data structure that is used to test whether an element is a member of a set. False positives are possible, but false negatives are not. Elements can be adde
阅读全文
摘要:考虑一下这个场景 , 使用网络爬虫高速爬取大量的网页内容 , 如果想把这些网页进行实时聚类 , 并从中提取每个网页聚类的主题 . 我们应该怎么样去做 对于普通或常见的聚类算法 , 比如 K-means, 或 Hierarchical 聚类 , 无法适用于这个常见 , 对于这些聚类算法无法进行 incremental 聚类 , 即在聚类开始前必须知道整个数据集 , 而这个场景中的数据集是随着爬虫不断增多的 . 而且这些聚类算法的 performance 不够高 , 比如对于 K-means 需要不断的 partition 以达到比较好的聚类效果 . 所以向来聚类算法在我的印象中是低效的 , 而面
阅读全文
摘要:Stack, QueueStack是后进先出, LIFO, 队列为先进先出, FIFO 在python中两者, 都可以简单的用list实现, 进, 用append() 出, Stack用pop(), Queue用pop(0), pop的时候注意判断len(l) 对于优先队列, 要用到前面讲到的堆链表和多重数组这些数据结构在python中就没有存在的价值, 用list都能轻松实现散列表为了满足实时查询的需求而产生的数据结构, 查询复杂度的期望是O(1), 最差为O(n) 问题描述, 对于n个(key, value)对, 怎样存储可以在O(1)的时间复杂度内获取特定key所对应的value. 这个
阅读全文
摘要:先列出一些算法复杂度的标识符号的意思, 最常用的是O,表示算法的上届,如 2n2 = O(n2 ), 而且有可能是渐进紧确的, 意思是g(n)乘上一个常数系数是可以等于f(n)的,就是所谓的a<=b。而o的区别就是非渐进紧确的,如2n = o(n2 ), o(n2 )确实可以作为2n的上届, 不过比较大, 就是所谓的a其他符号表示了下届,和非渐进紧确的下届, a>=b, a>b 还有既是上届也是下届, 就是a=bBubble Sort冒泡排序效率是最低的, 对于list中任意一点, 都必须遍历其后所有元素以找到最小元素, 这个耗费是n所以对于完整的冒泡算法, 对list中n个
阅读全文
摘要:对于高效算法, 有些比较简单的技术, 如分治法, 随机化, 和递归求解技术.这边介绍些更为复杂的技术, 动态规划, 贪心算法当对于复杂问题设计算法时, 首先会想到使用分治法 来解决, 分而治之, 一个很有哲理性的思路, 再复杂的问题都可以不断分解到你可以轻松解决的粒度, 把所有简单问题都解决完后, 组合在一起就得到了复杂问题的解, 可以看出其中典型的递归求解的思路.使用分治法的要求, 各个子问题是独立 的 (即不包含公共的子子问题,子问题不重叠 ).如果子问题重叠, 用分治法就比较低效, 因为需要重复解决相同子问题, 这就产生算法冗余, 要考虑使用动态规划.动态规划 的实质是分治思想 和解决冗
阅读全文
摘要:在看搜索引擎做查询结果排序的用到了堆排序,特来复习一下。那么在深入堆排序之前先来列举一下常见的排序方法,Insertion sort ,最简单直观的排序方法,时间复杂度最坏O(n2 ),in place(Recall that a sorting algorithm sorts in place if only a constant number of elements of the input array are ever stored outside the array.)就是说除了输入数组,仅还需耗费常数大小的空间, 这里对于insert sorting,应该只在交换element时,需
阅读全文
摘要:1. 模运算模运算很有用, 最常用的是钟表.还有二进制负数的补码, 有2n 个数, [-2n-1 , 2n-1 -1]正数当然直接表示成2进制即可, 对于负数就需要用补码, 即[1, 2n-1 ] 的二进制表示的取反再加一.以前对这个补码不理解, 所以也一直记不住, 其实:Any number in the range -2n-1 to 2n-1 - 1 is stored modulo 2n. Negative numbers -x therefore end up as 2n -x.原来如此.模运算对于加,减,乘,指数运算, 都很容易理解, 也都可以先进行模运算再加减乘. 就是除比较复杂,
阅读全文