O'Reilly logo

Sams Teach Yourself C++ in 24 Hours, Third Edition by Jesse Liberty

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Summary

In this hour you learned about linked lists.

A linked list is a dynamically sized collection. Each data object is held in a node in the list. To get to a particular node, you must start at one end of the list and walk the list to the node you need.

You saw how to encapsulate limited functionality into each small class in the list and how these well-designed objects can work together synergistically. The node hierarchy uses inheritance to factor out common node methods such as Insert(). Nodes use virtual functions to allow you to treat the various kinds of Nodes polymorphically. For example, when you call Insert() you do not need to know if you are calling it on a head node, a tail node or an internal node.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required