SlideShare a Scribd company logo
2
Most read
3
Most read
10
Most read
RECAP
 Data structure is a particular way of storing
and organizing data in a computer so that it
can be used efficiently.
 Different kinds of data structures are suited
to different kinds of applications, and some
are highly specialized to specific tasks.
 Linear (Array, queue, Linked list and stack)
 Non Linear ( tree and graph)
INTRODUCTION TO QUEUE
In ordinary English, a queue is
defined as a waiting line, like a line
of people waiting to purchase
tickets, where the first person in
line is the first person served.
REAL LIFE EXAMPLES OF QUEUE ARE:
1. A queue of people at ticket-window: The person who
comes first gets the ticket first. The person who is
coming last is getting the tickets in last. Therefore, it
follows first-in-first-out (FIFO) strategy of queue.
2. Luggage checking machine: Luggage checking
machine checks the luggage first that comes first.
Therefore, it follows FIFO principle of queue.
3. Patients waiting outside the doctor's clinic: The
patient who comes first visits the doctor first, and the
patient who comes last visits the doctor last.
Therefore, it follows the first-in-first-out (FIFO) strategy
of queue.
IN COMPUTER APLICATION
 For computer applications, we similarly
define a queue to be a list in which all
additions to the list are made at one
end, and all deletions from the list are
made at the other end.
 Queues are also called first-in, first-out
lists , or FIFO for short.
As in all parts of life, it is often necessary
to wait one’s turn before having access
to something.
Within a computer system there may be
queues of tasks waiting for the
printer, for access to disk storage etc…
IN COMPUTER APLICATION
COMPUTER APPLICATION EXAMPLES
 Imagine you have a web-site which serves files to
thousands of users. You cannot service all requests, you
can only handle say 100 at once. A fair policy would be
first-come-first serve: serve 100 at a time in order of
arrival. A Queue would definitely be the most appropriate
data structure.
 Similarly in a multitasking operating system, the CPU
cannot run all jobs at once, so jobs must be batched up
and then scheduled according to some policy. Again, a
queue might be a suitable option in this case.
 Say you have a number of documents to be printed at
once. Your OS puts all of these docs in a queue and
sends them to the printer. The printer takes and prints
each document in the order the docs are put in the
queue, ie, First In, First Out.
QUEUE OPERATIONS.
Indeed, we need to perform two operations with
queues:
append (or enqueue) - put an entry to the
queue, and
serve (also called delete or dequeue) -
remove an entry from the queue.
The entry in a queue ready to be served, that is, the
first entry that will be removed from the queue, is
called the front of the queue(or, sometimes, the
head of the queue).
Similarly, the last entry in the queue, that is, the one
most recently added, is called the rear (or the tail ) of
the queue.
STACK — ELEMENTS ARE PULLED IN LAST-IN
FIRST-OUT-ORDER (E.G. A STACK OF PAPERS)
QUEUE — ELEMENTS ARE PULLED IN FIRST-IN
FIRST-OUT-ORDER (E.G. A LINE IN A CAFETERIA)
A Graphic Model of a Queue
HOW HEAD AND TAIL CHANGE
Queue operation
RECAP
 It is a list in which all additions to the list are
made at one end, and all deletions from the
list are made at the other end.
 Say you have a number of documents to be
printed at once. Your OS puts all of these
docs in a queue and sends them to the
printer. The printer takes and prints each
document in the order the docs are put in the
queue, ie, First In, First Out.
TO PREPARE FOR NEXT SESSION
 Stack
 Operations on a stack
 Differences between queues and stack

More Related Content

PPT
Queue data structure
PPTX
queue & its applications
PPTX
stack & queue
PPTX
Priority queue in DSA
PPTX
Presentation on queue
PPTX
Data structure and its types
PPTX
Queue in Data Structure
PPTX
Stack and Queue
Queue data structure
queue & its applications
stack & queue
Priority queue in DSA
Presentation on queue
Data structure and its types
Queue in Data Structure
Stack and Queue

What's hot (20)

PPTX
Lecture 6 data structures and algorithms
PDF
Queue as data_structure
PPTX
PPTX
Queues in C++
PDF
UNIT I LINEAR DATA STRUCTURES – LIST
PPTX
Priority Queue in Data Structure
PPTX
Stack organization
PPTX
My lectures circular queue
PPT
Data structures using c
PPTX
Lecture 2 data structures and algorithms
PPTX
Stacks in DATA STRUCTURE
PPTX
PPT
Data Structures with C Linked List
PPTX
Linear and Binary search
PDF
BCA DATA STRUCTURES SEARCHING AND SORTING MRS.SOWMYA JYOTHI
PPTX
Bfs and Dfs
PPTX
Stacks IN DATA STRUCTURES
PPTX
Introduction to data structure
PPT
Queue Data Structure
PDF
Lecture 6 data structures and algorithms
Queue as data_structure
Queues in C++
UNIT I LINEAR DATA STRUCTURES – LIST
Priority Queue in Data Structure
Stack organization
My lectures circular queue
Data structures using c
Lecture 2 data structures and algorithms
Stacks in DATA STRUCTURE
Data Structures with C Linked List
Linear and Binary search
BCA DATA STRUCTURES SEARCHING AND SORTING MRS.SOWMYA JYOTHI
Bfs and Dfs
Stacks IN DATA STRUCTURES
Introduction to data structure
Queue Data Structure
Ad

Similar to Ppt presentation of queues (20)

PPTX
Queue using array with all the diagrams ppt.pptx
PPTX
Chapter 4 queue.pptx
PPTX
7-DSA- Queue.pptx in detail for students
PDF
Basic Terminologies of Queue...Basic operations on Queue
PPTX
Data structure day4
PPTX
Queue types of queue and algorithms and queue
PPTX
DSA MCA Stack-and-Queue-Data-Structures.pptx
PDF
Queue ADT for data structure for computer
PPTX
PPT Lecture 3.3.1 queue newccccccccccc.pptx
PPTX
Data Structures and Agorithm: DS 09 Queue.pptx
PPTX
UNIT-2.pptx
PPTX
Data structure
PDF
Lab 07 (2).pdfbdvdyve dhdysbsnjsnsvdvydbdns
PPT
Chapter 7 ds
PPTX
Understanding the Concepts and Applications of Stack and Queue
PPTX
DS UNIT2QUEUES.pptx
PPT
Queue AS an ADT (Abstract Data Type)
PPTX
Stack_and_Queue_Presentation_Final (1).pptx
PPTX
Stack_and_Queue_Presentation_Final (1).pptx
Queue using array with all the diagrams ppt.pptx
Chapter 4 queue.pptx
7-DSA- Queue.pptx in detail for students
Basic Terminologies of Queue...Basic operations on Queue
Data structure day4
Queue types of queue and algorithms and queue
DSA MCA Stack-and-Queue-Data-Structures.pptx
Queue ADT for data structure for computer
PPT Lecture 3.3.1 queue newccccccccccc.pptx
Data Structures and Agorithm: DS 09 Queue.pptx
UNIT-2.pptx
Data structure
Lab 07 (2).pdfbdvdyve dhdysbsnjsnsvdvydbdns
Chapter 7 ds
Understanding the Concepts and Applications of Stack and Queue
DS UNIT2QUEUES.pptx
Queue AS an ADT (Abstract Data Type)
Stack_and_Queue_Presentation_Final (1).pptx
Stack_and_Queue_Presentation_Final (1).pptx
Ad

More from Buxoo Abdullah (14)

PPTX
1.1.2 HEXADECIMAL
PPTX
MONEY & BANKING
PPTX
Retail trade
PPTX
1.1.3 DATA STORAGE
PPTX
CODING WITH PYTHON PART 1
PPTX
2.1.1 PROBLEM SOLVING & DESIGN
PPTX
1.1.1 BINARY SYSTEM
PPTX
COMPUTER SCIENCE PRE RELEASE 2210 FOR NOVEMBER 2018 P22
PPTX
Computer health & safety issues
PPTX
Program & language generation
PPTX
Data and information
PPT
Computer languages
PPTX
Input devices
PPTX
Formative & summative evaluation
1.1.2 HEXADECIMAL
MONEY & BANKING
Retail trade
1.1.3 DATA STORAGE
CODING WITH PYTHON PART 1
2.1.1 PROBLEM SOLVING & DESIGN
1.1.1 BINARY SYSTEM
COMPUTER SCIENCE PRE RELEASE 2210 FOR NOVEMBER 2018 P22
Computer health & safety issues
Program & language generation
Data and information
Computer languages
Input devices
Formative & summative evaluation

Recently uploaded (20)

PDF
Microbial disease of the cardiovascular and lymphatic systems
PDF
Pre independence Education in Inndia.pdf
PDF
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
PPTX
Introduction_to_Human_Anatomy_and_Physiology_for_B.Pharm.pptx
PDF
Module 4: Burden of Disease Tutorial Slides S2 2025
PDF
Mark Klimek Lecture Notes_240423 revision books _173037.pdf
PDF
RMMM.pdf make it easy to upload and study
PPTX
Microbial diseases, their pathogenesis and prophylaxis
PDF
STATICS OF THE RIGID BODIES Hibbelers.pdf
PDF
01-Introduction-to-Information-Management.pdf
PPTX
Final Presentation General Medicine 03-08-2024.pptx
PDF
102 student loan defaulters named and shamed – Is someone you know on the list?
PPTX
The Healthy Child – Unit II | Child Health Nursing I | B.Sc Nursing 5th Semester
PPTX
Pharma ospi slides which help in ospi learning
PPTX
PPH.pptx obstetrics and gynecology in nursing
PPTX
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
PDF
O7-L3 Supply Chain Operations - ICLT Program
PDF
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
PPTX
Institutional Correction lecture only . . .
PPTX
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
Microbial disease of the cardiovascular and lymphatic systems
Pre independence Education in Inndia.pdf
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
Introduction_to_Human_Anatomy_and_Physiology_for_B.Pharm.pptx
Module 4: Burden of Disease Tutorial Slides S2 2025
Mark Klimek Lecture Notes_240423 revision books _173037.pdf
RMMM.pdf make it easy to upload and study
Microbial diseases, their pathogenesis and prophylaxis
STATICS OF THE RIGID BODIES Hibbelers.pdf
01-Introduction-to-Information-Management.pdf
Final Presentation General Medicine 03-08-2024.pptx
102 student loan defaulters named and shamed – Is someone you know on the list?
The Healthy Child – Unit II | Child Health Nursing I | B.Sc Nursing 5th Semester
Pharma ospi slides which help in ospi learning
PPH.pptx obstetrics and gynecology in nursing
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
O7-L3 Supply Chain Operations - ICLT Program
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
Institutional Correction lecture only . . .
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...

Ppt presentation of queues

  • 1. RECAP  Data structure is a particular way of storing and organizing data in a computer so that it can be used efficiently.  Different kinds of data structures are suited to different kinds of applications, and some are highly specialized to specific tasks.  Linear (Array, queue, Linked list and stack)  Non Linear ( tree and graph)
  • 2. INTRODUCTION TO QUEUE In ordinary English, a queue is defined as a waiting line, like a line of people waiting to purchase tickets, where the first person in line is the first person served.
  • 3. REAL LIFE EXAMPLES OF QUEUE ARE: 1. A queue of people at ticket-window: The person who comes first gets the ticket first. The person who is coming last is getting the tickets in last. Therefore, it follows first-in-first-out (FIFO) strategy of queue. 2. Luggage checking machine: Luggage checking machine checks the luggage first that comes first. Therefore, it follows FIFO principle of queue. 3. Patients waiting outside the doctor's clinic: The patient who comes first visits the doctor first, and the patient who comes last visits the doctor last. Therefore, it follows the first-in-first-out (FIFO) strategy of queue.
  • 4. IN COMPUTER APLICATION  For computer applications, we similarly define a queue to be a list in which all additions to the list are made at one end, and all deletions from the list are made at the other end.  Queues are also called first-in, first-out lists , or FIFO for short.
  • 5. As in all parts of life, it is often necessary to wait one’s turn before having access to something. Within a computer system there may be queues of tasks waiting for the printer, for access to disk storage etc… IN COMPUTER APLICATION
  • 6. COMPUTER APPLICATION EXAMPLES  Imagine you have a web-site which serves files to thousands of users. You cannot service all requests, you can only handle say 100 at once. A fair policy would be first-come-first serve: serve 100 at a time in order of arrival. A Queue would definitely be the most appropriate data structure.  Similarly in a multitasking operating system, the CPU cannot run all jobs at once, so jobs must be batched up and then scheduled according to some policy. Again, a queue might be a suitable option in this case.  Say you have a number of documents to be printed at once. Your OS puts all of these docs in a queue and sends them to the printer. The printer takes and prints each document in the order the docs are put in the queue, ie, First In, First Out.
  • 7. QUEUE OPERATIONS. Indeed, we need to perform two operations with queues: append (or enqueue) - put an entry to the queue, and serve (also called delete or dequeue) - remove an entry from the queue. The entry in a queue ready to be served, that is, the first entry that will be removed from the queue, is called the front of the queue(or, sometimes, the head of the queue). Similarly, the last entry in the queue, that is, the one most recently added, is called the rear (or the tail ) of the queue.
  • 8. STACK — ELEMENTS ARE PULLED IN LAST-IN FIRST-OUT-ORDER (E.G. A STACK OF PAPERS) QUEUE — ELEMENTS ARE PULLED IN FIRST-IN FIRST-OUT-ORDER (E.G. A LINE IN A CAFETERIA)
  • 9. A Graphic Model of a Queue
  • 10. HOW HEAD AND TAIL CHANGE
  • 12. RECAP  It is a list in which all additions to the list are made at one end, and all deletions from the list are made at the other end.  Say you have a number of documents to be printed at once. Your OS puts all of these docs in a queue and sends them to the printer. The printer takes and prints each document in the order the docs are put in the queue, ie, First In, First Out.
  • 13. TO PREPARE FOR NEXT SESSION  Stack  Operations on a stack  Differences between queues and stack