A Queue is a linear Data Structure using the principle of FIFO
to handle data.
FIFO
stands for First In First Out
.
Time Complexity: O(1)
A Stack is a linear Data Structure using the principle of LIFO
or FILO
to handle data.
LIFO
stands for Last In First Out.
FILO
stands for First In Last Out.
Time complexity: O(1)
queue.py
- Python script for the Queue.
stack.py
- Python script for the stack.
simulation.py
- Python script in which I use two stacks to simulate a queue.