21.4 DYNAMIC DATA STRUCTURES

The data whose size and shape are not initially defined leads to dynamic data structures. These structures grow or shrink in time (means dynamic). Again, a lot of study has gone into these structures and some basic structures have emerged. The simplest of such structures is a linked list. Here in this section we will be discussing simple linear linked list.

21.4.1. Linked list

As the name suggests, linked list is a list. Are lists similar to ordinary arrays? Well, list is an abstract data structure. An array is a tool available in C++ to implement it. However, we need not use arrays to implement the list. We can create a list by linking (with the help of pointers) the list elements. Therefore, the name linked list. ...

Get Object Oriented Programming with C++, Second Edition 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.