Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 2

Assignment – 2

1. What is Queue?

A queue is a data structure and is used when you want access only to the first data item
inserted. It’s a First-In-First-Out (FIFO) structure.

(Reference - Data Structures and Algorithms in Java)

2. How many types of queues?

There are four types of queue. They are -

(1) Circular Queue

(2) Priority Queue

(3) Double-ended Queue

(4) Simple Queue

(Reference - Data Structures and Algorithms in Java)

3. Explain Queue Data Structure with examples.

A queue works like the line at the movies. The first person to join the rear of the line is
the first person to reach the front of the line and buy a ticket. The last person to line up is the
last person to buy a ticket (or—if the show is sold out—to fail to buy a ticket). They’re also used
to model real-world situations such as people waiting in line at a bank, airplanes waiting to take
off, or data packets waiting to be transmitted over the Internet.

(Reference - Data Structures and Algorithms in Java)

4. Write the application area of the Queue.

The application area of the Queue are -

CPU scheduling - to keep track of processes for the CPU

Handling website traffic - by implementing a virtual HTTP request queue

Printer Spooling - to store print jobs

In routers - to control how network packets are transmitted or discarded

Traffic management - traffic signals use queues to manage intersections


(Reference - https://www.masaischool.com/blog/applications-of-queue/)

You might also like