29 ms·
It may be confusing, but it applies to any dynamically-sized container (for mutable containers, the impact is smaller and often can be lessened by increasing th
by Someone 6y ago
It may be confusing, but it applies to any dynamically-sized container (for mutable containers, the impact is smaller and often can be lessened by increasing the capacity of the container before appending items, but often, you don’t know the target capacity in advance). You’ll have to learn it, or use a language that doesn’t have dynamically-sized containers such as classical COBOL, FORTRAN or (to a lesser extent) Pascal.
So, this is a lesson you just have to learn at some time.