![](https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Advanced Data Structure
Irisssy
这个作者很懒,什么都没留下…
展开
-
AVL tree
AVL treeDefinationAn empty binary tree is height balanced. If T is a nonempty binary tree with TLT_LTL and TRT_RTR as its left and right subtrees, then T is height balanced iff(1) TLT_LTL and ...原创 2019-06-25 08:55:33 · 919 阅读 · 0 评论 -
Parallel Algorithm
Parallel Random Access Machine (PRAM)EREW PRAM模型(Exclusive-Read Exclusive-Write)。每次只允许一台处理机读或写某一共享单元内容。CREW PRAM模型(Concurrent-Read Exclusive-Write)。每次可允许多台处理机同时读同一个共享单元内容,但每次只允许一台处理机向某个共享单元写内容。ERC...原创 2019-06-27 16:09:50 · 1034 阅读 · 1 评论 -
Randomized Algorithm
Hiring problemsExercises原创 2019-06-27 14:07:57 · 1111 阅读 · 0 评论 -
Local Search
原创 2019-06-26 16:17:34 · 1915 阅读 · 0 评论 -
Approximation
Approximation ratio【Definition】 An algorithm has an approximation ratio of ρ\rhoρ(n) if, for any input of size n, the cost C of the solution produced by the algorithm is within a factor of ρ\rhoρ (n...原创 2019-06-26 15:35:04 · 2646 阅读 · 0 评论 -
Time Complexity
Time ComplexityBSTAVLSplayRB-treeB+ tree(M)SearchO(n)O(logn)O(logn)O(logn)O(logM/2n)O(log_{M/2}n)O(logM/2n)InsertO(n)O(logn)O(logn)O(logn)O(MlogMlogn)O(\frac{M}{logM}logn)O...原创 2019-06-26 10:55:48 · 350 阅读 · 0 评论 -
NP-Completeness
1、P问题是指:用确定图灵机可以在多项式时间内解决的问题。一个问题可以找到一个能在多项式的时间里解决它的算法。也就是复杂度为O(1),O(log(n)),O(n^a)等的。2、NP问题:用非确定图灵机可以在多项式时间内解决。可以在多项式的时间里验证一个解的问题(注意,NP问题不是非P问题!!!)。所以比如最短路问题、TSP旅行商问题,一个解出来了(一条路径出来了),那么我验证这个解(计算这条路径...原创 2019-06-26 10:54:28 · 1573 阅读 · 0 评论 -
Greedy Algorithm
Greedy algorithm works only if the local optimum is equal to the global optimum.活动选择问题Consider any nonempty subproblem SkS_kSk, and let am be an activity in SkS_kSk with the earliest finish time....原创 2019-06-26 09:11:56 · 1209 阅读 · 0 评论 -
Dynamic programming
Ordering matrix multiplicationcode/* r contains number of columns for each of the N matrices */ /* r[ 0 ] is the number of rows in matrix 1 */ /* Minimum number of multiplications is left in M[ 1...原创 2019-06-26 08:49:32 · 185 阅读 · 0 评论 -
Divide & Conquer
Master theoremsubstitution methodrecursion tree methodmaster methodExercisesWhich one of the following is the lowest upper bound of T(n) for the following recursion T(n)=2T(n)+lognT(n)=2T(\s...原创 2019-06-25 17:35:32 · 641 阅读 · 0 评论 -
Binomial Queue
Time complexityFind min: O(logN)Merge: O(logN)Insert: average time is const, worst case is O(N)A binomial queue of N elements can be built by N successive insertions in O(N) time.Tworst=O(logN),T...原创 2019-06-25 16:16:19 · 717 阅读 · 0 评论 -
Skew Heap
https://blog.csdn.net/Woolseyyy/article/details/51586384原创 2019-06-25 15:22:02 · 818 阅读 · 0 评论 -
Leftist Heap
二叉堆的合并需要耗费O(N)的代价,而leftist heap只需O(logN)[Definition]Npl (X)The null path length, Npl(X), of any node X is the length of the shortest path from X to a node without two children. Define Npl(NULL) = –...原创 2019-06-25 15:12:16 · 487 阅读 · 0 评论 -
Inverted file index
while ( read a document D ) { while ( read a term T in D ) { if ( Find( Dictionary, T ) == false ) Insert( Dictionary, T ); Get T’s posting list; Insert a node ...原创 2019-06-25 14:26:08 · 318 阅读 · 0 评论 -
B+ Tree
DefinitionA B+ tree of order M is a tree with the following structural properties:(1) The root is either a leaf or has between 2 and M children.(2) All nonleaf nodes (except the root) have betwee...原创 2019-06-25 13:48:54 · 704 阅读 · 1 评论 -
Red-BlackTree
DefinitionA red-black tree is a binary search tree that satisfies the following red-black properties:(1) Every node is either red or black.(2) The root is black.(3) Every leaf (NIL) is black.(...原创 2019-06-25 10:58:10 · 2089 阅读 · 1 评论 -
Amortized analysis
Amortized analysis聚合分析核算法势能法c^i−ci=credit=Φ(Di)−Φ(Di−1)\hat c_i - c_i = credit = \Phi (D_i)- \Phi (D_{i-1})c^i−ci=credit=Φ(Di)−Φ(Di−1)∑c^i=∑ci+Φ(D−i)−Φ(Di−1)\sum \hat c_i = \sum c_i + \Phi(...原创 2019-06-25 10:50:09 · 539 阅读 · 0 评论 -
Splay tree
Splay tree将被查找的节点置于根的位置deletionfind xremove xfindmax ( TLT_LTL )make TRT_RTR the right child of the root of TLT_LTLhttps://blog.csdn.net/Woolseyyy/article/details/51512589...原创 2019-06-25 09:14:13 · 282 阅读 · 0 评论 -
External sorting
number of passes: 1+⌈log2(N/M)⌉1+ \lceil log_2 (N/M) \rceil1+⌈log2(N/M)⌉seek time: O(number of passes)a k-way mergenumber of passes: 1+⌈logk(N/M)⌉1+ \lceil log_k (N/M) \rceil1+⌈logk(N/M)⌉require...原创 2019-06-27 16:15:26 · 601 阅读 · 0 评论