9Collections and Their Organization

We have introduced basic data types and user-defined types (array, structures, etc.) in Chapters 2 and 6. Basic data types are predefined by the C++ compiler system, and user-defined data types consist of elements of base types and user-defined types. We call the data collections. In many cases, system-defined operations aren’t enough and user-defined operations are required to deal with specific problems. A collection class can be defined by encapsulating data and operations with the object-oriented method.

There are two types of collections: linear collections and nonlinear collections. A node in a linear collection can be specified by its position. It is possible to determine the order of the elements in ...

Get C++ Programming 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.