Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

ake into consideration a variation of dynamic arrays where, as an array fills up, we triple its size rather than double it. (Assume array size

ake 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.

Using accounting method prove that the amortized cost per operation(insertion) is at most 2.5

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions