February 2022
Beginner
848 pages
22h 40m
English
list and forward_listThe Standard Template Library (STL) offers a doubly linked list: the template class std::list. The main advantages of a linked list are fast and constant time insertion and removal of elements. C++ also supports a singly linked list, the class std::forward_list, which can be traversed in only one direction.
In this lesson, you learn
■ How to instantiate list and forward_list
■ How to use the STL list classes, including for insertion and removal of elements
■ How to reverse and sort elements
std::listA linked list is a collection of nodes in which each node, in addition to containing a value or an object of interest, also points to the next node; that is, each node links to ...
Read now
Unlock full access