August 2012
Intermediate to advanced
976 pages
30h 17m
English
forward_list OperationsTo understand why forward_list has special versions of the operations to add and remove elements, consider what must happen when we remove an element from a singly linked list. As illustrated in Figure 9.1, removing an element changes the links in the sequence. In this case, removing elem3 changes elem2; elem2 had pointed to elem3, but after we remove elem3, elem2 points to elem4.
Figure 9.1. forward_list Specialized Operations
When we add or remove an element, the element before the one we added or ...
Read now
Unlock full access