September 2017
Beginner to intermediate
384 pages
9h 18m
English
The container std::list<T> represents a linked list in memory. Schematically, it looks like this:

Notice that each node in the list contains pointers to its "next" and "previous" nodes, so this is a doubly linked list. The benefit of a doubly linked list is that its iterators can move both forwards and backwards through the list--that is, std::list<T>::iterator is a bidirectional iterator (but it is not random-access; getting to the nth element of the list still requires O(n) time).
std::list supports many of the same operations as std::vector, except for those operations that require random access ...
Read now
Unlock full access