Chapter 21. Data Structures
Much that I bound, I could not free; Much that I freed returned to me.
Lee Wilson Dodd
'Will you walk a little faster?' said a whiting to a snail,
'There's a porpoise close behind us, and he's treading on my tail.'
There is always room at the top.
Push on keep moving.
I'll turn over a new leaf.
Miguel de Cervantes
In this chapter you will learn:
To form linked data structures using pointers, self-referential classes and recursion.
To create and manipulate dynamic data structures such as linked lists, queues, stacks and binary trees.
To use binary search trees for high-speed searching and sorting.
To understand various important applications of linked data structures.
To understand how to create reusable data structures with class templates, inheritance and composition.
21.2 Self-Referential Classes
21.3 Dynamic Memory Allocation and Data Structures
21.4 Linked Lists
Answers to Self-Review Exercises
Special SectionBuilding Your Own Compiler