splay按中序遍历启发式合并复杂度证明
原论文
摘要
Step 1
证明splay是一棵Dynamic Finger Search Tree,访问的复杂度为
leator and Tarjan introduced
splay\ trees as a class of self-adjusting binary search trees supporting searches, insertions and deletions in amortizedO(log\ n) time. That splay trees can be used as efficient finger search trees was later proved by Cole[17, 18]: Given anaccess in a splay tree is $O(log\ d)$ where accesses include searches, insertions, and deletions. Notice that the statement only applies in the presence of one finger, which always points to the last accessed element.
Step 2
证明合并两棵大小分别为
Optimal merging of two sets also follows as an application of finger search trees [28]. Assume that the two sequences are represented as finger search trees, and that we repeatedly insert the
n elements from the shorter sequence into the larger sequence using a finger that moves monotonically from left to right. If thei th insertion advances the fingerd_i positions, we have that the total work of performing then finger searches and insertions is
由于将它们合并有
Since sets can be represented as sorted sequences, the above merging algorithm gives immediately raise to optimal, i.e.
O(log{n + m \choose n}) = O(n\ log\ \frac{m}{n}) time, algorithms for set union, intersection, and difference operations [28]. For a survey of data structures for set representations see [41].
Step 3
证明按任意顺序合并