LecX - COT 6936: Topics in Algorithms Giri Narasimhan ECS...

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

View Full Document Right Arrow Icon
1 COT 6936: Topics in Algorithms Giri Narasimhan ECS 254A / EC 2443; Phone: x3748 giri@cs.fiu.edu http://www.cs.fiu.edu/~giri/teach/COT6936_S10.html https://online.cis.fiu.edu/portal/course/view.php?id=427 1 2/2/10 COT 6936 Amortized Analysis In amortized analysis, we are looking for the time complexity of a sequence of n operations, instead of the cost of a single operation. Cost of a sequence of n operations = n S(n) , where S(n) = worst case cost of each of the n operations Amortized Cost = T(n)/n , where T(n) = worst case total cost of the n operations in the sequence. Amortized cost can be small even when some operations in that sequence are expensive. Often, the worst case may not occur in every operation . The cost of expensive operations may be ‘paid for’ by charging to other less expensive operations. 2 2/2/10 COT 6936 Problem 1: Stack Operations Data Structure: Stack Operations: Push(s,x ) : Push object x into stack s . Cost: T(push)= O(1). Pop(s) : Pop the top object in stack s . Cost: T(pop)=O(1).
Background image of page 1

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

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 02/18/2012 for the course CIS 6936 taught by Professor Giri during the Spring '12 term at FIU.

Page1 / 4

LecX - COT 6936: Topics in Algorithms Giri Narasimhan ECS...

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

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