Stacks and Queues

Stacks

A stack is a list where the last item added is the first removed. Like a stack of plates.

Python 3

Queues

A queue is a list where the last item added is the last removed. Like a line in a supermarket where the last person has to wait the longest.

Python 3

Reference

https://docs.python.org/3/tutorial/datastructures.html