Reading_Notes

View the Project on GitHub Hiba-Almade/Reading_Notes

Stacks & Queues

What is a Stack?

Data structure that consists of Nodes. Each Node references the next Node in the stack.

>> Common terminology for a stack is:

Stacks follow : (FILO) First In Last Out

This means that the first item added in the stack will be the last item popped out of the stack.


What is a Queue?

Data structure that consists of Nodes. Each Node references the next Node in the queue.

>> Common terminology for a queue is:

Queues follow: (FIFO) First In First Out

This means that the first item in the queue will be the first item out of the queue.