Queue
Queue
OUR TEAM
Mario Sebastian Iker Gael
Salazar Del Villar Mercado Arzate
Lizeth martinez Dania Ximena
Garduño Lozano Nájera
Isaac Cortez Monserrat
Gonzalez Velazquez Valdés
QUEUE?
A “queue” is a linear data structure that
follows the *First In First Out (FIFO)*
principle, meaning the first element added is
the first one to be removed.
BASIC
OPERATIONS ON
QUEUE
ENQUEUE()
Inserts an element at the end of the queue i.e. at the rear
end.
The following steps should be taken to enqueue (insert)
data into a queue:
Check if the queue is full.
If the queue is full, return overflow error and exit.
If the queue is not full, increment the rear pointer to
point to the next empty space.
Add the data element to the queue location, where the
rear is pointing.
return success.
DEQUEUE()
This operation removes and returns an element that is at
the front end of the queue.
The following steps are taken to perform the dequeue
operation:
Check if the queue is empty.
If the queue is empty, return the underflow error and
exit.
If the queue is not empty, access the data where the
front is pointing.
Increment the front pointer to point to the next
available data element.
FRONT()
his operation returns the element at the front end without
removing it.