A stack is a data structure that consists of *Nodes*, Each *Node* references the next Node in the stack.
Terminology for a stack is :
will always be an O(1)
Stacks concepts:
FILO (First In Last Out)
LIFO (Last In First Out)
Stack Visualization
A Queue is a linear structure that follows a particular order in which the operations are performed. The order is First In First Out (FIFO).
An example: any queue of consumers for a resource where the consumer that came first is served first. The difference between stacks and queues is in removing.
Terminology for a queue:
will always be an O(1)
Queues concepts:
Queue Visualization