12 ms·
That's why you use a growth factor, say doubling the backing array when you need to grow. That makes the amortized cost of adding an item constant. The only ca
by alayne 13y ago
That's why you use a growth factor, say doubling the backing array when you need to grow. That makes the amortized cost of adding an item constant.
The only case where a LL may be preferable are when you care about performance of inserting/deleting in the middle of a list.