Stacks and Queues

Project #0

Define LIFO and FIFO. What is the difference? What is a stack? What is a queue?

Project #1

*Lists are one of the 4 built-in data types in Python that are used to store collections of data. (list, tuple, set, and dictionary)

Project #2

Convert the programs in Project #1 into a single interactive program.

Project #3

Repeat project #1 but modify the classes to use linked lists. (single or double linked list?)

Generate performance statistics and display/plot them. How do the two classes (list and linked list) compare?

Project #4

Question: What is the difference between Python "Queue" and "collections.deque"?

Using the Python "collections.deque", write a program to demonstrate LIFO and FIFO (stack and queue).

Create a stack class (LIFIO queue). Implement the following methods:

Note: TOS is Top Of Stack.

Create a queue class (FIFO queue). Implement similar methods. (Front and back of queue.)

Python Documentation

queue — A synchronized queue class

collections — Container datatypes

Data Structures - More on Lists