Answered step by step
Verified Expert Solution
Question
1 Approved Answer
In lecture we did an amortized analysis of the AddLast operation on a list represented by a dynamic array. We did this under the assumption
In lecture we did an amortized analysis of the AddLast operation on a list represented by a dynamic array. We did this under the assumption that the underlying static array is replaced by one that is two times as long each time it fills up. We found that if:a is the cost of an AddLast operation when array doubling is not needed, and r is the per-element cost of copying the elements of an array into one that is twice as long then the average cost of an AddLast operation is a+ 2r In other words, the overhead of the dynamic expansion technique is about 2r per AddLast operation. How does the answer change if the static array is always replaced by one that is three times as long each time it fills up
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started