3 ms·
Does it have to be one or the other? You could allocate blocks of memory for the list then when it will be filled up you allocate more and add a pointer to it.
by seiferteric 5y ago
Does it have to be one or the other? You could allocate blocks of memory for the list then when it will be filled up you allocate more and add a pointer to it.
- dmurray 5y agoThis breaks O(1) access by index, because the objects in the list may have different sizes.