摘要
Step 1
证明splay是一棵Dynamic Finger Search Tree,访问的复杂度为。
leator and Tarjan introduced as a class of self-adjusting binary search trees supporting searches, insertions and deletions in amortized time. That splay trees can be used as efficient finger search trees was later proved by Cole[17, 18]: Given an initialization cost, the amortized cost of an access at distance d from the preceding access in a splay tree is 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
证明合并两棵大小分别为的Dynamic Finger Search Tree复杂度为。
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 elements from the shorter sequence into the larger sequence using a finger that moves monotonically from left to right. If the th insertion advances the finger positions, we have that the total work of performing the finger searches and insertions is , where . By convexity of the logarithm the total work becomes bounded by .
由于将它们合并有种中序,所以至少需次比较,即为合并它们的下界,所以这是归并两个有序列的最优方法。
Since sets can be represented as sorted sequences, the above merging algorithm gives immediately raise to optimal, i.e. time, algorithms for set union, intersection, and difference operations [28]. For a survey of data structures for set representations see [41].
Step 3
证明按任意顺序合并个点,总复杂度为. 画出merge tree,自底向上归纳可证将根为的子树的叶子合并成一棵splay复杂度为, 所以根节点(即所有合并完成时)复杂度为.
