You are on page 1of 4

Name: Aaron B.

Zulueta Assessment: Final EA2


CYS: BCS22 Professor: Ma’am Evangeline Pamintuan

1. Simple Queue

Simple Queue or Linear Queue is a type of queue that the insertion takes place on one
end which called the rear and, and the deletion takes place from the opposite end which
called the front end. It uses the First-In and First-out rule. The main disadvantage of the
Simple Queue is that we cannot insert more elements despite that there is still space
available for new elements.

A real-life illustration of the Simple Queue is government office queue that has a fixed
control number of people who are allowed to have a transaction. The figure below shows
that the fixed-control number of people are 5.

After the woman finished the transaction, the woman can leave the office. Even though
that there is still space for another person, the limit has already reached thus the queue
prohibits another person to enter.
2. Circular Queue

Circular Queue is similar to Simple Queue; however, the rear end and the front end are

connected to each other. If there is an empty spot in a circular queue, the new element

can be inserted there by simply increasing the rear value.

A real-life illustration of the Circular Queue is the traffic light. Each light of traffic light

turns ON and OFF. The red light turns ON in a specific period, after the specific time, the

red light will turn OFF then yellow light immediately turns ON and the red light turns

OFF. After the specific time, the yellow light will turn OFF and the green light will turn

ON and the cycle will continue thus creating a Circular Queue.


3. Priority Queue

Priority Queue is a queue that organize a queue based on priority. If there are elements

that have the same priority, the First-in and First-out rule will be observed. Priority queue

insertion happens based on arrival, but priority queue deletion happens according to

priority. In addition, there are two types of queues, the Ascending Priority Queue which

sorts the elements from lowest to highest and the lowest will be the first to be deleted

while the Descending Priority Queue sorts the elements from highest to lowest and the

highest will be the first to be deleted.

A real-life illustration of the Priority Queue is a queue in a government office but the

PWD, Senior Citizen, and pregnant women are the priority. As we can see in the

illustration below, the queue is not organized because it follows the First-in and First-out

rule.

Then the queue will be organized to a Priority Queue. The old woman and the girl will be
prioritized but still follow the First-in and First-out rule.
4. Double-Ended Queue

Double-Ended Queue or Deque is a type of queue that allows the elements to be inserted
or deleted from both the rear end and the front end. Double-Ended Queue can be used
as a stack and a queue because it supports insertion and deletion on both ends. It does not
use First-in and First-out rule, but it uses a different kind of method which is the Last-in
and First-out method. In addition, there are two types of Deque, the Input Restricted
Deque which the element can only be inserted on one end but can be deleted on both ends
while the Output Restricted Deque enables the element to be inserted on both ends but
can only be deleted on one end.
A real-life example of a Deque is an entrance at a theme park where the visitors who
already booked online can immediately enter or be at the first number of the queue. The
figure below represents Output Restricted Deque because people can be inserted from
both ends but only one exit from the queue.

Because there is only one entrance at the queue, the visitors who already booked online
can enter the theme park or the queue line without waiting at the last number of the
queue.

You might also like