Escolar Documentos
Profissional Documentos
Cultura Documentos
Presented by:
Jovar V.Tabat
Ma.Liezell N. Acosta
What is Queue?
25 H 5H 6H
Jason 5H Melai 6H Carol Null
Arr [3]
Arr [2]
Top = 0
Bottom = 0
Arr [4]
Arr [1]
Arr [5]
Arr [6]
One-Dimensional Array as
Circular Queues
♥When using this, the bottom of the
queue is not always located in
Arr[1].Instead, the bottom, and top
of the queue is monitored by two
variables which we will also call TOP
and BOTTOM.
♥TOP and BOTTOM contain the value
(0)
♥ If we insert “A” into the queue, TOP
will be 1 and BOTTOM will be 1 too.
Representation of
Circular Queue
Arr[2] Arr[3]
Top = 1
Arr[1]
Bottom = 1 Arr[4]
A
Arr[6] Arr[5]
Arr[1]
Bottom = 1 Arr[4]
A
Arr[6] Arr[5]
Arr[1]
Arr[4]
Arr[6] Arr[5]
Arr[1] Arr[2] Arr[3] Arr[4] Arr5] Arr[6] Arr[7] Arr[8] Arr[9] Arr[10]
A
Arr[1] Arr[2] Arr[3] Arr[4] Arr5] Arr[6] Arr[7] Arr[8] Arr[9] Arr[10]
A
Arr[1] Arr[2] Arr[3] Arr[4] Arr5] Arr[6] Arr[7] Arr[8] Arr[9] Arr[10]