lecture07Splaytrees - 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 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) 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
Example of Amortized Analysis How does vector work? What is the data organization in memory? If I do a sequence of push_back
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.

This note was uploaded on 07/25/2008 for the course CSE 331 taught by Professor M.mccullen during the Spring '08 term at Michigan State University.

Page1 / 28

lecture07Splaytrees - 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