Skip to content

Latest commit

 

History

History
3 lines (2 loc) · 428 Bytes

9.37.md

File metadata and controls

3 lines (2 loc) · 428 Bytes

A list does not support random access, and element of list is stored seperately in memory. There is no need to reallocate its elements, and thus no need to preallocate memory. So the "capacity" of a list is the same with its size.

An array has a fixed size, there is also no need to reallocate its elements, and thus no need to preallocate memory. So the "capacity" of an array is the same with its size too.