Efficiency of growing a dynamic array by a fixed constant each time?
So when a dynamic array is doubled in size each time an element is added, I understand how the time complexity for expanding is O(n) n being the elements. What about if the the array is copied and moved to a new array that is only 1 size bigger when it is full? (instead of doubling) When we resize by some constant C, it the time complexity always O(n)? templatetypedef If you grow by some fixed constant C, then no, the runtime will not be O(n). Instead, it will be Θ(n 2 ). To see this, think about what happens if you do a sequence of C consecutive operations. Of those operations, C - 1 of them