© Will Briggs 2021
W. BriggsC++20 for Lazy Programmershttps://doi.org/10.1007/978-1-4842-6306-8_22

22. Linked Lists

Will Briggs1  
(1)
Lynchburg, VA, USA
 

To add an element to a Vector, we must allocate new memory and copy over the existing elements. That’s not quick! Here’s a storage scheme that’s faster to update.

What lists are and why have them

All around the city, a group of superheroes is waiting. They have a scheme for notifying each other if their powers are needed: each has the phone number of another, who has the number of another, until the last one on the list, who has none (see Figure 22-1).
../images/477913_2_En_22_Chapter/477913_2_En_22_Fig1_HTML.png
Figure 22-1

Our city, with three superheroes in a ...

Get C++20 for Lazy Programmers: Quick, Easy, and Fun C++ for Beginners now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.