0% found this document useful (0 votes)
6 views14 pages

University Institute of Engineering Computer Science Engineering

The document provides an overview of queues in computer science, explaining the First In First Out (FIFO) principle and various operations such as enqueue and dequeue. It also discusses different types of queues, including circular queues, priority queues, and double-ended queues, along with their applications in real-life and computer science contexts. Additionally, it includes references for further reading on algorithms and data structures.

Uploaded by

tusharsingh06.ts
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views14 pages

University Institute of Engineering Computer Science Engineering

The document provides an overview of queues in computer science, explaining the First In First Out (FIFO) principle and various operations such as enqueue and dequeue. It also discusses different types of queues, including circular queues, priority queues, and double-ended queues, along with their applications in real-life and computer science contexts. Additionally, it includes references for further reading on algorithms and data structures.

Uploaded by

tusharsingh06.ts
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 14

Department of Computer Science and Engineering (CSE)

UNIVERSITY INSTITUTE OF
ENGINEERING
COMPUTER SCIENCE ENGINEERING
Bachelor of Engineering
Design and Analysis of
Algorithms(CSH-311/ITH-311)
Queues (CO2)

Topic: Queue DISCOVER . LEARN . EMPOWER

University Institute of Engineering (UIE)


Department of Computer Science and Engineering (CSE)

Learning Objectives & Outcomes


Objective:
• To use FIFO technique.
• To perform all manipulation operations on data
structures.
• To perform traversal of Queue.
Outcome:
• Student will understand
 stacks and its operations.
 Application of Stack

University Institute of Engineering (UIE)


Department of Computer Science and Engineering (CSE)

Queue
• Queue is a linear structure which follows a particular
order in which the operations are performed. The order
is First In First Out (FIFO). A good example of queue is
any queue of consumers for a resource where the
consumer that came first is served first.

University Institute of Engineering (UIE)


Department of Computer Science and Engineering (CSE)

Queues
• Stores a set of elements in a particular order
• Queue principle: FIRST IN FIRST OUT
• = FIFO
• It means: the first element inserted is the first one to be
removed
• Example

University Institute of Engineering (UIE)


Department of Computer Science and Engineering (CSE)

Queue Applications

• Real life examples


– Waiting in line
– Waiting on hold for tech support
• Applications related to Computer Science
– Threads
– Job scheduling (e.g. Round-Robin algorithm for CPU allocation)

University Institute of Engineering (UIE)


Department of Computer Science and Engineering (CSE)

FIRST IN FIRST OUT

University Institute of Engineering (UIE)


Department of Computer Science and Engineering (CSE)

Operations on Queue

• Mainly the following four basic operations are performed


on queue:
• Enqueue: Adds an item to the queue. If the queue is full,
then it is said to be an Overflow condition.
• Dequeue: Removes an item from the queue. The items
are popped in the same order in which they are pushed.
If the queue is empty, then it is said to be an Underflow
condition.
Front: Get the front item from queue.
Rear: Get the last item from queue.

University Institute of Engineering (UIE)


Department of Computer Science and Engineering (CSE)

Types of Queues
• Circular Queue
• Priority Queue
• De-queue

University Institute of Engineering (UIE)


Department of Computer Science and Engineering (CSE)

Circular Queue

• In a normal Queue, we can insert elements until queue


becomes full. But once queue becomes full, we cannot
insert the next element even if there is a space in front of
queue. Circular Queue is designed to overcome the
limitation of Simple Queue.
• Circular Queue is a linear data structure in which the
operations are performed based on FIFO (First In First
Out) principle and the last position is connected back to
the first position to make a circle. It is also called ‘Ring
Buffer’

University Institute of Engineering (UIE)


Department of Computer Science and Engineering (CSE)

DeQueue
• Double ended queue allows insertion and deletion from
both the ends i.e. elements can be added or removed
from rear as well as front end.

University Institute of Engineering (UIE)


Department of Computer Science and Engineering (CSE)

Priority Queue
• Priority queue is a type of queue where each element has
a priority value and the deletion of the elements is
depended upon the priority value. In case of max-priority
queue, the element will be deleted first which has the
largest priority value and in case of min-priority queue
the element will be deleted first which has the minimum
priority value.

University Institute of Engineering (UIE)


Department of Computer Science and Engineering (CSE)

REFERENCES
Text books:
•Cormen, Leiserson, Rivest, Stein, “Introduction to Algorithms”, Prentice Hall of
India, 3rd edition 2012. problem, Graph coloring.
•Horowitz, Sahni and Rajasekaran, “Fundamentals of ComputerAlgorithms”,
University Press (India), 2nd edition

Websites:
1.https://www.studytonight.com/data-structures/queue-data-structure
2.https://www.geeksforgeeks.org/queue-data-structure/

University Institute of Engineering (UIE)


Department of Computer Science and Engineering (CSE)

Summary
Queues:
•Types of queues
•Operations on queues

University Institute of Engineering (UIE)


THANK YOU

University Institute of Engineering (UIE)

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy