9 Apr
2008
9 Apr
'08
8:58 p.m.
Am Mittwoch, 9. April 2008 22:41:25 schrieb H. Verbeet:
On 09/04/2008, Stefan Dösinger <stefan(a)codeweavers.com> wrote:
You usually grow the memory by a factor of the old size because this reduces the number of needed grows. So growing the stack is an O(log(n)) instead of O(n), which is a huge difference.
No, the amortized time per push is O(1). The realloc becomes more expensive as the array gets larger. Good point