Question: In the vector solution to the problem of maintaining resizable arrays shown in class, we allocate a new array with twice the size as the

In the vector solution to the problem of maintaining resizable arrays shown in class, we allocate a new array with twice the size as the old one when inserting into a full array. In this question, we use a dierent solution. The only dierence is that instead of doubling the array size, we allocate a new array with three times the size as the old one upon inserting into a full array. Suppose that no deletion is performed over the resizable array. With this simplication, perform amortized analysis to show that insertion still uses O(1) amortized time. Hint: One solution uses the potential method. Reviewing the potential function in the analysis shown in class may be helpful. This time you may wish to design a dierent potential function based on the same idea. (This does not imply that you are required to use potential method.)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!