Queue Data Structure
A queue is an abstract data type that serves as an ordered collection of elements. A simple queue typically has several operations:
- push: adds an item to the tail of the queue
- pop: removes and returns an item from the head of the queue
- returns an item from the head of the queue
- returns the number of items in the queue
The order in which elements come off a queue gives rise to its alternative name, FIFO (first in, first out)
Think of a line to get tickets. The first person to get in line will be the first person to receive a ticket and get out of line.
References
- boot.dev
Next -> linked-list-data-structure
#structure #data #boot_dev #queue #computer_science #programming #memory