I understand the difference between vector and list regarding the complexity of common operations on them. But supposing we need to deal with very large lists or vectors (i.e. millions of elements), can we say that memory allocation is more likely to fail when working with vectors?
AFAIK, when working with vectors, the elements are stored contiguously. This means that a big block of memory needs to be allocated in order to store all elements, which seems more likely to fail in case of a fragmented heap.
On the other hand, no big blocks of memory are allocated when working with a list; elements aren't stored contiguously.