Chapter 19

Container Classes

Simple data structures are found at the heart of almost all nontrivial computer programs. Example data structures include vectors, linked lists, stacks, queues, binary trees, sets, and dictionaries. Because data structures are so common, one would expect them to be ideal for development as reusable components. Indeed, it is possible to create such components, but there are subtle issues involved that can trap the unwary programmer.

An exploration of the problems in developing reusable container classes is, for this reason, a good illustration of how the features of a programming language influence the style of development, as well as a demonstration of some of the powers and some of the limitations of object-oriented ...

Get An Introduction to Object-Oriented Programming, 3rd 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.