✅ The verified answer to this question is available below. Our community-reviewed solutions help you understand the material better.
Consider a dynamically-sized array to which we append items. It starts with capacity 1, and doubles its capacity whenever it becomes full. Suppose the cost of inserting an item is 𝑂(1), and the cost of doubling from 𝑚 to 2𝑚 is 𝑂(m) .
Let the potential function be: \phi = 2*n - capacity , where n are the items in the array at that moment in time.
What is the Amortized Cost for the operations?