Lec26 - Bottom-Up Splay Trees–Analysis • Actual and amortized complexity of join is O(1 • Amortized complexity of search insert delete and

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Bottom-Up 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.

Page1 / 9

Lec26 - Bottom-Up Splay Trees–Analysis • Actual and amortized complexity of join is O(1 • Amortized complexity of search insert delete and

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online