The previous chapter presented an application of abstract data types, the Game of Life.
In this chapter, we switch gears and begin our exploration of generic data structures. The first and perhaps simplest data structure we look at is the Stack. It has many practical uses in application development.
A stack organizes data in a last-in, first-out (LIFO). Only the last item inserted into a stack is accessible.
Because of LIFO, the most obvious application is to reverse a sequence of insertions. For example, if ...