In the "lighting tour" of Stroustrup's
4th edition of TC++PL, he says:
I recommend the standard-library vector as the default type for sequences of elements: you need a reason to choose another.
It's clear why one would choose a set
over a vector based on the invariant
of a set.
But what about list
and deque
? Unfortunately I don't have enough knowledge/experience to know when to use those over a vector.
Rather than going down a rabbit hole re-searching linked-lists
and deque
's; which I am going to do when I reach the later chapters. I was hoping someone can give a brief conceptual outline of when there's a reason to use linked-list
or a deque
over a vector?