3 ms·
When it runs out of space, it resizes to (at least) a multiple of its current space to avoid having to resize too often, making pushing a constant-time operatio
by minitech 9y ago
When it runs out of space, it resizes to (at least) a multiple of its current space to avoid having to resize too often, making pushing a constant-time operation on average. 1304209 is the smallest size in the sequence starting with an empty array that’s at least 1048576.