In lecture today, the following topics were covered:
- General definitions of 2 new linear data structures, Stacks and Queues, and discussion that these data structures are essentially restrictions on how additions and deletions are defined for a container.
- Definition of common Stack operations
- A discussion of implementing Stack operations using an array and using a LinkedList (LinkedList being the better choice)
- Discussion of some real-world examples of uses of Stacks
Here is a Stack implementation built on top of a LinkedList: Stack.h, Stack.cpp, stackMain.cpp (These files assume that LinkedList has all the functions needed implemented (such as empty, getDataAtIndex - they do on my computer, but they don’t necessarily in your lab LinkedLists, etc).
Here is a PDF of the powerpoint slides from today.