lecture07Splaytrees

# lecture07Splaytrees - Splay Trees Amortized Analysis...

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

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

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

View Full Document
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)
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.

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

View Full Document
Example of Amortized Analysis How does vector work? What is the data organization in memory? If I do a sequence of push_back
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
Ask a homework question - tutors are online