lecture07Splay - Splay Trees & Amortized Analysis...

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

View Full Document Right Arrow Icon
1 Splay Trees & Amortized Analysis Concept of Amortized Analysis Splaying the tree life time total complexity for m operations is O(MlogN), where N is the size of the tree
Background image of page 1

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

View Full DocumentRight Arrow Icon
2 Amortized Analysis Amortization Put money aside, for gradual payment of a debt (original meaning) e.g. students lose $ now to gain a lot later Average the running time of operations in a sequence over the entire sequence Motivation A sequence of data structure related operations What is the total time complexity of the entire sequence? Worst-case analysis: sum of the worst-case time of each operation (overly pessimistic) Average-case analysis: average over all inputs (prob. distribution: inaccurate, very hard) Amortized analysis (combine worst-case analysis and average- case analysis)
Background image of page 2
3 Amortization Idea Balanced trees O(log n) per operation, O(m log n) for m operations. What if we settle for this alone? I.e., some individual operations might be slow, as long as total  behavior is good. Splay trees  O(n) per operation worst case, O(m log n) for m operations.
Background image of page 3

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

View Full DocumentRight Arrow Icon
4 Example of Amortized Analysis the vector data structure How does vector work?
Background image of page 4
Image of page 5
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 29

lecture07Splay - Splay Trees & Amortized Analysis...

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

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