lecture07Splay

# lecture07Splay - Splay Trees Amortized Analysis Concept of...

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

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

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) 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)
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
4 Example of Amortized Analysis the vector data structure How does vector work?
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### Page1 / 29

lecture07Splay - Splay Trees Amortized Analysis Concept of...

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

View Full Document
Ask a homework question - tutors are online