上一页 1 ··· 4 5 6 7 8 9 10 11 12 ··· 34 下一页
摘要: A suffix array is a sorted array of all suffixes of a given string. The definition is similar to Suffix Tree which is compressed trie of all suffixes ... 阅读全文
posted @ 2014-11-08 13:04 linyx 阅读(420) 评论(0) 推荐(0) 编辑
摘要: In graph theory, a Eulerian trail (or Eulerian path) is a trail in a graph which visits every edge exactly once. Similarly, an Eulerian circuit or Eul... 阅读全文
posted @ 2014-11-07 19:53 linyx 阅读(463) 评论(0) 推荐(0) 编辑
摘要: 8.2Imagine you have a call center with three levels of employees: respondent, manager, and director. An incoming telephone call must be first allocate... 阅读全文
posted @ 2014-11-04 21:38 linyx 阅读(239) 评论(0) 推荐(0) 编辑
摘要: Implement pow(x, n).快速求幂,注意n是负数的情况。 1 class Solution { 2 public: 3 double pow(double x, int n) { 4 double ans = 1.0; 5 int symbol ... 阅读全文
posted @ 2014-11-04 19:45 linyx 阅读(125) 评论(0) 推荐(0) 编辑
摘要: The gray code is a binary numeral system where two successive values differ in only one bit.Given a non-negative integer n representing the total numb... 阅读全文
posted @ 2014-11-04 16:27 linyx 阅读(144) 评论(0) 推荐(0) 编辑
摘要: 分布式缓存出于如下考虑,首先是缓存本身的水平线性扩展问题,其次是缓存大并发下的本身的性能问题,再次避免缓存的单点故障问题(多副本和副本一致性)。分布式缓存的核心技术包括首先是内存本身的管理问题,包括了内存的分配,管理和回收机制。其次是分布式管理和分布式算法,其次是缓存键值管理和路由。Memcache... 阅读全文
posted @ 2014-11-03 18:07 linyx 阅读(205) 评论(0) 推荐(0) 编辑
摘要: Given API: int Read4096(char* buf); It reads data from a file and records the position so that the next time when it is called it read the next 4k cha... 阅读全文
posted @ 2014-11-02 15:50 linyx 阅读(491) 评论(0) 推荐(0) 编辑
摘要: 匈牙利算法,求二分图最大匹配。若P是图G中一条连通两个未匹配顶点的路径,并且属于M的边和不属于M的边(即已匹配和待匹配的边)在P上交替出现,则称P为相对于M的一条增广路径。(M为一个匹配)由增广路的定义可以推出下述三个结论:P的路径长度必定为奇数,第一条边和最后一条边都不属于M。所以Line 25-... 阅读全文
posted @ 2014-11-02 13:25 linyx 阅读(202) 评论(0) 推荐(0) 编辑
摘要: Time limit : 2sec / Stack limit : 256MB / Memory limit : 256MBProblemCarol is a great alchemist.In her world, each metal has a name of 2N (N is an int... 阅读全文
posted @ 2014-11-01 23:26 linyx 阅读(283) 评论(0) 推荐(0) 编辑
摘要: 1. BST只保存preorder或者postorder就够了,递归有O(n^2)和O(n)算法。非递归有利用栈的O(n)算法。2. Complete binary treelevel traversal就行了。3. Full binary tree用一个bit来保存该结点是internal nod... 阅读全文
posted @ 2014-10-31 21:31 linyx 阅读(454) 评论(0) 推荐(0) 编辑
上一页 1 ··· 4 5 6 7 8 9 10 11 12 ··· 34 下一页