Queues Definition, Types and Representing PDF
Queues Definition, Types and Representing PDF
A queue is a linear list of elements in which deletion can take place only at one
end, called the front, and insertions can take place only at the other end, called the rear.
The term front and rear are used in describing a linear list only when it is
implemented as a queue.
Queue is also called first-in-first-out (FIFO) lists. Since the first element in a
queue will be the first element out of the queue. In other words, the order in which
elements enters a queue is the order in which they leave.
There are main two ways to implement a queue :
1. Circular queue using array
2. Linked Structures (Pointers)
In
a
circular queue the last node is connected back to the first node to make
circle.
Circular
Elements
are added at the rear end and the elements are deleted at front
end of the
Both
It
queue.
the front and the rear pointers points to the beginning of the array.
is also called as Ring buffer.
Items