{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

# lec26 - Bottom-Up Splay TreesAnalysis Actual and amortized...

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

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.

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

View Full Document
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 0 1 1 0 1 2 Example rank(root) = floor(log 2 n). When you insert, potential may increase by floor(log 2 n)+1.
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern