What is the difference between list and vector?

There are few differences:
list and vector implement fundamentally different data structures.
The major difference is the way of element access. Vector elements may accessed randomly while list elements must be accessed sequentially.
Iterators are different as a result of the first item: list support bi-directional iterators while vector uses random access iterator.
Some methods are difference (for example, only list supports merge and splice, adds push_front and pop_front etc.

No comments: