Computer Science 210
Data Structures
Fall 2017, Siena College
Lecture 23: Linear Structures: Stacks and Queues
Date: Monday, November 6, 2017
Agenda
- Announcements
- No office hours today-tomorrow-Wednesday, while I am at a conference
- Dr. Liu is holding class on Monday and Dr. Flatland will supervise labs on Wednesday
- Use a slow and steady approach for Lab 7: Iterators and More Lists - it's a big lab
- Linear structures
- stacks
- array-based
- Vector-based
- List-based
- comparisons
- queues
- List-based
- Vector-based
- array-based
- why these restricted structures?
Lecture 23 Assignment
Due at the start of class, Friday, November 10.
Please submit answers to these questions in
Blackboard under "Lecture 23 Assignment" by the start of
class. We will discuss these questions at the start of class, so no
late submissions can be accepted.
For 10.8 and 10.10 below, the add/remove operations can be interleaved
in any valid order.
- Bailey Problem 10.8, p. 246. (5 points)
- Bailey Problem 10.10, p. 246. (5 points)
- Bailey Problem 10.12, p. 246. (5 points)
Terminology
- linear structures
- internal representation
- stack
- last in, first out (LIFO)
- push, pop, peek
- call stack
- queue
- first in, first out (FIFO)
- enqueue
- dequeue