This preview shows pages 1–3. Sign up to view the full content.
This preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
Unformatted text preview: BottomUp Splay Trees–Analysis • Actual and amortized complexity of join is O(1). • Amortized complexity of search, insert, delete, and split is O(log n). • Actual complexity of each splay tree operation is the same as that of the associated splay. • Sufficient to show that the amortized complexity of the splay operation is O(log n). Potential Function • size(x) = #nodes in subtree whose root is x. • rank(x) = floor(log 2 size(x)). • P(i) = Σ x is a tree node rank(x). square4 P(i) is potential after i’th operation. square4 size(x) and rank(x) are computed after i’th operation. square4 P(0) = 0. • When join and split operations are done, number of splay trees > 1 at times. square4 P(i) is obtained by summing over all nodes in all trees. Example • size(x) is in red. 20 10 6 8 40 30 1 • rank(x) is in blue. • Potential = 5. 2 3 1 2 6 1 1 1 2 Example • rank(root) = floor(log 2 n)....
View
Full
Document
This note was uploaded on 03/22/2012 for the course CSE 3101 taught by Professor Shani during the Fall '10 term at University of Florida.
 Fall '10
 shani
 Data Structures

Click to edit the document details