Question
Take into consideration a variation of dynamic arrays where, as an array fills up, we triple its size rather than double it. (Assume array size
Take into consideration a variation of dynamic arrays where, as an array fills up, we triple its size rather than double it. (Assume array size is 1 and then when it fills up, we initialized a new array of size 3 and move the data from old array to new array. Same way when this array fills up we create new array of triple size i.e 9...and so on) So the array size will be always powers of 3. For eg on 10th insertion size of array is changed from 9 to 27.
Question : Now use the aggregate cost method to find an upperbound of 2.5 for the amortized cost of each operation
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