96.8k views
5 votes
How many cost units are spent in the entire process of performing 40 consecutive append operations on an empty array which starts out at capacity 5, assuming that the array will grow by a constant 2 spaces each time a new item is added to an already full dynamic array

User Murnax
by
3.2k points

1 Answer

3 votes

Answer:

Step-by-step explanation:

260 cost units, Big O(n) complexity for a push

User Mwoa
by
2.7k points