170 likes | 368 Vues
Objectives. In this chapter you will:Learn about stacksExamine various stack operationsLearn how to implement a stack as an arrayLearn how to implement a stack as a linked listDiscover stack applicationsLearn how to use a stack to remove recursion. Objectives. Learn about queuesExamine variou
E N D
1. C++ Programming: From Problem Analysis to Program Design, Third Edition Chapter 19: Stacks and Queues
2. Objectives In this chapter you will:
Learn about stacks
Examine various stack operations
Learn how to implement a stack as an array
Learn how to implement a stack as a linked list
Discover stack applications
Learn how to use a stack to remove recursion
3. Objectives Learn about queues
Examine various queue operations
Learn how to implement a queue as an array
Learn how to implement a queue as a linked list
Discover queue applications
4. Stacks Stack: list of homogenous elements
Addition and deletion occurs only at one end, called the top of the stack
In a cafeteria, the second tray can be removed only if first tray has been removed
Last in first out (LIFO) data structure