Stacks and Queues
Learn how stack and queues work in Python.
We'll cover the following...
This lesson lists different implementations of stack and queue provided by Python 3 and explains when to use which built-in support.
Introduction
A stack is a data structure that follows the LIFO (Last In First Out) order for push (insertion) and pop (deletion) functions.
A queue is a data structure that follows the FIFO (First In First Out) order for enqueue (insertion) and dequeue (deletion) functions.
Stack
Queue
Stack and queue implementation
Using list
As you know, list
is one of the basic built-in data structures in Python. It allows random access in ...
Access this course and 1400+ top-rated courses and projects.