Question: Consider a dynamic array where the capacity doubles when additional space is needed and shrinks by 50% when the size falls below 1/4 capacity.

Consider a dynamic array where the capacity doubles when additional space is needed and shrinks by 50% when the size falls below 1/4 capacity. What will be the amortized big-O of an append() operation where an element is inserted at the end of the array.? A O(n2) B. 0(1) c. O(Ig n) D. O(n)
Step by Step Solution
3.59 Rating (160 Votes )
There are 3 Steps involved in it
The answer is B The amortized cost of the append operation is O1 This ... View full answer
Get step-by-step solutions from verified subject matter experts
