SlideShare a Scribd company logo
1 of 25
• Yastee A. Shah
By:
• 16IT148
ID NO.:
• Data Structure and Algorithm
(IT247)
Subject:
2
3
Introduction
■ A data structure is a particular way of organizing
data so that it can be used efficiently.
■ Different kind of data structure suits for the
different kind of applications.
■ Types:
Integer, Float, Pointer, Char (Primitive)
Array ,Tree, Graph, Linked list, Stack, Queue (Non-
primitive)
4
*http://jcsites.juniata.edu/faculty/kruse/cs240/queues.htm
What Makes a Structure
to be said “QUEUE”
■ Linear data structure.
■ Used for temporary storage of data values.
■ A new element is added at the end called Rear
End.
■ The existing elements deleted from the end
called Front End.
■ First-in-First-out property.
5
*http://jcsites.juniata.edu/faculty/kruse/cs240/queues.htm
Types Of Queue
■ Simple Queue
■ Circular Queue
■ Deque
■ Priority Queue
6
*https://courses.cs.washington.edu/courses/cse143/02au/slides/18b-
SAndQ-applications.pdf
Simple Queue
7
Circular Queue
When a resource is shared among multiple consumers.
1.Baggage carousel :
A group of advocates having a discussion on a round table or an
airport baggage carousel.
2.Traffic System:
In computer controlled traffic signals ,repeatedly shifting the lights
at regular intervals.
8
*https://www.geeksforgeeks.org/circular-queue-set-1-introduction-
array-implementation/
3.Round Robin Technique.
Disk Scheduling:
When data is transferred asynchronously (data not necessarily
received at same rate as sent) between two processes. Examples
include IO Buffers, pipes, file IO, etc.
CPU scheduling:
Operating Systems often maintain a queue of processes that are
ready to execute or are waiting for some event to occur.
9
4. Memory management:
The used memory locations in ordinary
queues can be in circular queues.
5.In case of printers and uploading
images.
10
Deque
APPLICATIONS
1.A-steal job scheduling Algorithm.
 The A-Steal algorithm implements task scheduling for
several processors(multiprocessor scheduling).
 The processor gets the first element from the deque.
 When one of the processor completes execution of its
own threads it can steal a thread from another processor.
 It gets the last element from the deque of another
processor and executes it.
11
*http://en.cppreference.com/w/cpp/container/deque
12
*National Energy Technology Laboratory, US Department
of Energy.
2.Undo-Redo operations in Software Application:
Deque is storing a software application's list of undo operations.
3. MoneyControl App:
It will show the stocks you last visited, it will remove the stocks
after some time and will add the latest ones.
4. To handle data that needs to be pruned after some time. Eg-
a browser's history.
The recently visited sites are added at one end, say the rear.
Now we obviously want a limit on the number of sites which are
stored in our history deque. So when that limit is reached, the
elements at the front are removed from the deque, to
accommodate new insertions. This is where a deque is useful
over a stack.
But we may also want to remove the newly visited sites at the
rear of our history deque. This is where a deque is useful over a
queue.
13
5.Palindrome- checker.
14
15
But I
came
FIRST…
But he
is
NAMO…
Priority Queue
First-in-first-out
Values come
out in order by priority!!!
It’s typically implemented using
Heap data structure.
16
Applications
1. Artificial Intelligence :
Finds the shortest path between two vertices of a weighted
graph, trying out the most promising routes first.
So, the fringe is used to keep track of unexplored routes, the
one for which a lower bound on the total path length is smallest
is given highest priority.
Prim's algorithm.
2. Using a priority queue to sort
17
*https://secweb.cs.odu.edu/~zeil/cs361/web/website/Lectures/priority
Queues/pages/ar01s02.html
18
3.Bandwidth Management:
Manage limited resources such as bandwidth on a
transmission line from a network router. In the event of
outgoing traffic queuing due to insufficient bandwidth,
all other queues can be halted to send the traffic from
the highest priority queue upon arrival. This ensures
that the prioritized traffic (such as real-time traffic, e.g.
an RTP stream of a VoIP connection) is forwarded with
the least delay and the least likelihood of being rejected
due to a queue reaching its maximum capacity. All other
traffic can be handled when the highest priority queue is
empty.
Usually a limitation is set to limit the bandwidth that
traffic from the highest priority queue can take, in order
to prevent high priority packets from choking off all
other traffic. Eg: Cisco Callmanager.
19
20
*http://www.cplusplus.com/reference/deque/deque/
21
22
23
Better Way??
Future of Queue
24
25

More Related Content

Similar to Application of Queue.pptx

Efficient Resource Allocation to Virtual Machine in Cloud Computing Using an ...
Efficient Resource Allocation to Virtual Machine in Cloud Computing Using an ...Efficient Resource Allocation to Virtual Machine in Cloud Computing Using an ...
Efficient Resource Allocation to Virtual Machine in Cloud Computing Using an ...ijceronline
 
OVERVIEW ON SPARK.pptx
OVERVIEW ON SPARK.pptxOVERVIEW ON SPARK.pptx
OVERVIEW ON SPARK.pptxAishg4
 
Noorbehbahani data preprocessing for anomaly based network intrusion
Noorbehbahani data preprocessing for anomaly based network intrusionNoorbehbahani data preprocessing for anomaly based network intrusion
Noorbehbahani data preprocessing for anomaly based network intrusionnoorbehbahani
 
Computer organization & architecture chapter-1
Computer organization & architecture chapter-1Computer organization & architecture chapter-1
Computer organization & architecture chapter-1Shah Rukh Rayaz
 
Porting a Streaming Pipeline from Scala to Rust
Porting a Streaming Pipeline from Scala to RustPorting a Streaming Pipeline from Scala to Rust
Porting a Streaming Pipeline from Scala to RustEvan Chan
 
Automating the Hunt for Non-Obvious Sources of Latency Spreads
Automating the Hunt for Non-Obvious Sources of Latency SpreadsAutomating the Hunt for Non-Obvious Sources of Latency Spreads
Automating the Hunt for Non-Obvious Sources of Latency SpreadsScyllaDB
 
Presentation on Data Structure
Presentation on Data StructurePresentation on Data Structure
Presentation on Data StructureMuntasirMuhit
 
The Overview of Discovery and Reconciliation of LTE Network
The Overview of Discovery and Reconciliation of LTE NetworkThe Overview of Discovery and Reconciliation of LTE Network
The Overview of Discovery and Reconciliation of LTE NetworkIRJET Journal
 
SF-TAP: Scalable and Flexible Traffic Analysis Platform (USENIX LISA 2015)
SF-TAP: Scalable and Flexible Traffic Analysis Platform (USENIX LISA 2015)SF-TAP: Scalable and Flexible Traffic Analysis Platform (USENIX LISA 2015)
SF-TAP: Scalable and Flexible Traffic Analysis Platform (USENIX LISA 2015)Yuuki Takano
 
talks-afanasyev2013ndnsim-tutorial.pptx
talks-afanasyev2013ndnsim-tutorial.pptxtalks-afanasyev2013ndnsim-tutorial.pptx
talks-afanasyev2013ndnsim-tutorial.pptxhazwan30
 
Supercomputer - Overview
Supercomputer - OverviewSupercomputer - Overview
Supercomputer - OverviewARINDAM ROY
 

Similar to Application of Queue.pptx (20)

Efficient Resource Allocation to Virtual Machine in Cloud Computing Using an ...
Efficient Resource Allocation to Virtual Machine in Cloud Computing Using an ...Efficient Resource Allocation to Virtual Machine in Cloud Computing Using an ...
Efficient Resource Allocation to Virtual Machine in Cloud Computing Using an ...
 
Chapter 7 ds
Chapter 7 dsChapter 7 ds
Chapter 7 ds
 
OVERVIEW ON SPARK.pptx
OVERVIEW ON SPARK.pptxOVERVIEW ON SPARK.pptx
OVERVIEW ON SPARK.pptx
 
Noorbehbahani data preprocessing for anomaly based network intrusion
Noorbehbahani data preprocessing for anomaly based network intrusionNoorbehbahani data preprocessing for anomaly based network intrusion
Noorbehbahani data preprocessing for anomaly based network intrusion
 
Computer organization & architecture chapter-1
Computer organization & architecture chapter-1Computer organization & architecture chapter-1
Computer organization & architecture chapter-1
 
Porting a Streaming Pipeline from Scala to Rust
Porting a Streaming Pipeline from Scala to RustPorting a Streaming Pipeline from Scala to Rust
Porting a Streaming Pipeline from Scala to Rust
 
Automating the Hunt for Non-Obvious Sources of Latency Spreads
Automating the Hunt for Non-Obvious Sources of Latency SpreadsAutomating the Hunt for Non-Obvious Sources of Latency Spreads
Automating the Hunt for Non-Obvious Sources of Latency Spreads
 
Apache Storm
Apache StormApache Storm
Apache Storm
 
Presentation on Data Structure
Presentation on Data StructurePresentation on Data Structure
Presentation on Data Structure
 
unit 2 hpc.pptx
unit 2 hpc.pptxunit 2 hpc.pptx
unit 2 hpc.pptx
 
Pipeline Computing by S. M. Risalat Hasan Chowdhury
Pipeline Computing by S. M. Risalat Hasan ChowdhuryPipeline Computing by S. M. Risalat Hasan Chowdhury
Pipeline Computing by S. M. Risalat Hasan Chowdhury
 
The Overview of Discovery and Reconciliation of LTE Network
The Overview of Discovery and Reconciliation of LTE NetworkThe Overview of Discovery and Reconciliation of LTE Network
The Overview of Discovery and Reconciliation of LTE Network
 
SF-TAP: Scalable and Flexible Traffic Analysis Platform (USENIX LISA 2015)
SF-TAP: Scalable and Flexible Traffic Analysis Platform (USENIX LISA 2015)SF-TAP: Scalable and Flexible Traffic Analysis Platform (USENIX LISA 2015)
SF-TAP: Scalable and Flexible Traffic Analysis Platform (USENIX LISA 2015)
 
talks-afanasyev2013ndnsim-tutorial.pptx
talks-afanasyev2013ndnsim-tutorial.pptxtalks-afanasyev2013ndnsim-tutorial.pptx
talks-afanasyev2013ndnsim-tutorial.pptx
 
U nit i data structure-converted
U nit   i data structure-convertedU nit   i data structure-converted
U nit i data structure-converted
 
Data Structures
Data StructuresData Structures
Data Structures
 
Supercomputer - Overview
Supercomputer - OverviewSupercomputer - Overview
Supercomputer - Overview
 
Intro_2.ppt
Intro_2.pptIntro_2.ppt
Intro_2.ppt
 
Intro.ppt
Intro.pptIntro.ppt
Intro.ppt
 
Intro.ppt
Intro.pptIntro.ppt
Intro.ppt
 

More from Yastee Shah

jdbc vs hibernate.pptx
jdbc vs hibernate.pptxjdbc vs hibernate.pptx
jdbc vs hibernate.pptxYastee Shah
 
FIND MINIMUM TIME TO FINISH ALL JOBS WITH GIVEN CONSTRAINTS.pptx
FIND MINIMUM TIME TO FINISH ALL JOBS WITH GIVEN CONSTRAINTS.pptxFIND MINIMUM TIME TO FINISH ALL JOBS WITH GIVEN CONSTRAINTS.pptx
FIND MINIMUM TIME TO FINISH ALL JOBS WITH GIVEN CONSTRAINTS.pptxYastee Shah
 
Edison's work habits and thinking about failure.pptx
Edison's work habits and thinking about failure.pptxEdison's work habits and thinking about failure.pptx
Edison's work habits and thinking about failure.pptxYastee Shah
 
Water Level Indicator
Water Level IndicatorWater Level Indicator
Water Level IndicatorYastee Shah
 
Types of virus and saviour
Types of virus and saviourTypes of virus and saviour
Types of virus and saviourYastee Shah
 

More from Yastee Shah (11)

AWT.pptx
AWT.pptxAWT.pptx
AWT.pptx
 
jdbc vs hibernate.pptx
jdbc vs hibernate.pptxjdbc vs hibernate.pptx
jdbc vs hibernate.pptx
 
FIND MINIMUM TIME TO FINISH ALL JOBS WITH GIVEN CONSTRAINTS.pptx
FIND MINIMUM TIME TO FINISH ALL JOBS WITH GIVEN CONSTRAINTS.pptxFIND MINIMUM TIME TO FINISH ALL JOBS WITH GIVEN CONSTRAINTS.pptx
FIND MINIMUM TIME TO FINISH ALL JOBS WITH GIVEN CONSTRAINTS.pptx
 
Edison's work habits and thinking about failure.pptx
Edison's work habits and thinking about failure.pptxEdison's work habits and thinking about failure.pptx
Edison's work habits and thinking about failure.pptx
 
Smart grid.pptx
Smart grid.pptxSmart grid.pptx
Smart grid.pptx
 
Html vs xhtml
Html vs xhtmlHtml vs xhtml
Html vs xhtml
 
Raid
RaidRaid
Raid
 
Water Level Indicator
Water Level IndicatorWater Level Indicator
Water Level Indicator
 
Types of virus and saviour
Types of virus and saviourTypes of virus and saviour
Types of virus and saviour
 
Output devices
Output devicesOutput devices
Output devices
 
Math
MathMath
Math
 

Recently uploaded

call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...Marc Dusseiller Dusjagr
 
भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,Virag Sontakke
 
Roles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceRoles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceSamikshaHamane
 
internship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developerinternship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developerunnathinaik
 
Pharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdfPharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdfMahmoud M. Sallam
 
Types of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxTypes of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxEyham Joco
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationnomboosow
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxpboyjonauth
 
Painted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaPainted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaVirag Sontakke
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxGaneshChakor2
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTiammrhaywood
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxOH TEIK BIN
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Celine George
 
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxRaymartEstabillo3
 
Historical philosophical, theoretical, and legal foundations of special and i...
Historical philosophical, theoretical, and legal foundations of special and i...Historical philosophical, theoretical, and legal foundations of special and i...
Historical philosophical, theoretical, and legal foundations of special and i...jaredbarbolino94
 

Recently uploaded (20)

call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
 
भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,
 
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
 
Roles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceRoles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in Pharmacovigilance
 
internship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developerinternship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developer
 
Pharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdfPharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdf
 
Types of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxTypes of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptx
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communication
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptx
 
OS-operating systems- ch04 (Threads) ...
OS-operating systems- ch04 (Threads) ...OS-operating systems- ch04 (Threads) ...
OS-operating systems- ch04 (Threads) ...
 
Painted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaPainted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of India
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptx
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
 
9953330565 Low Rate Call Girls In Rohini Delhi NCR
9953330565 Low Rate Call Girls In Rohini  Delhi NCR9953330565 Low Rate Call Girls In Rohini  Delhi NCR
9953330565 Low Rate Call Girls In Rohini Delhi NCR
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptx
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17
 
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
 
Historical philosophical, theoretical, and legal foundations of special and i...
Historical philosophical, theoretical, and legal foundations of special and i...Historical philosophical, theoretical, and legal foundations of special and i...
Historical philosophical, theoretical, and legal foundations of special and i...
 

Application of Queue.pptx

  • 1. • Yastee A. Shah By: • 16IT148 ID NO.: • Data Structure and Algorithm (IT247) Subject:
  • 2. 2
  • 3. 3
  • 4. Introduction ■ A data structure is a particular way of organizing data so that it can be used efficiently. ■ Different kind of data structure suits for the different kind of applications. ■ Types: Integer, Float, Pointer, Char (Primitive) Array ,Tree, Graph, Linked list, Stack, Queue (Non- primitive) 4 *http://jcsites.juniata.edu/faculty/kruse/cs240/queues.htm
  • 5. What Makes a Structure to be said “QUEUE” ■ Linear data structure. ■ Used for temporary storage of data values. ■ A new element is added at the end called Rear End. ■ The existing elements deleted from the end called Front End. ■ First-in-First-out property. 5 *http://jcsites.juniata.edu/faculty/kruse/cs240/queues.htm
  • 6. Types Of Queue ■ Simple Queue ■ Circular Queue ■ Deque ■ Priority Queue 6 *https://courses.cs.washington.edu/courses/cse143/02au/slides/18b- SAndQ-applications.pdf
  • 8. Circular Queue When a resource is shared among multiple consumers. 1.Baggage carousel : A group of advocates having a discussion on a round table or an airport baggage carousel. 2.Traffic System: In computer controlled traffic signals ,repeatedly shifting the lights at regular intervals. 8 *https://www.geeksforgeeks.org/circular-queue-set-1-introduction- array-implementation/
  • 9. 3.Round Robin Technique. Disk Scheduling: When data is transferred asynchronously (data not necessarily received at same rate as sent) between two processes. Examples include IO Buffers, pipes, file IO, etc. CPU scheduling: Operating Systems often maintain a queue of processes that are ready to execute or are waiting for some event to occur. 9
  • 10. 4. Memory management: The used memory locations in ordinary queues can be in circular queues. 5.In case of printers and uploading images. 10
  • 11. Deque APPLICATIONS 1.A-steal job scheduling Algorithm.  The A-Steal algorithm implements task scheduling for several processors(multiprocessor scheduling).  The processor gets the first element from the deque.  When one of the processor completes execution of its own threads it can steal a thread from another processor.  It gets the last element from the deque of another processor and executes it. 11 *http://en.cppreference.com/w/cpp/container/deque
  • 12. 12 *National Energy Technology Laboratory, US Department of Energy. 2.Undo-Redo operations in Software Application: Deque is storing a software application's list of undo operations. 3. MoneyControl App: It will show the stocks you last visited, it will remove the stocks after some time and will add the latest ones.
  • 13. 4. To handle data that needs to be pruned after some time. Eg- a browser's history. The recently visited sites are added at one end, say the rear. Now we obviously want a limit on the number of sites which are stored in our history deque. So when that limit is reached, the elements at the front are removed from the deque, to accommodate new insertions. This is where a deque is useful over a stack. But we may also want to remove the newly visited sites at the rear of our history deque. This is where a deque is useful over a queue. 13
  • 16. Priority Queue First-in-first-out Values come out in order by priority!!! It’s typically implemented using Heap data structure. 16
  • 17. Applications 1. Artificial Intelligence : Finds the shortest path between two vertices of a weighted graph, trying out the most promising routes first. So, the fringe is used to keep track of unexplored routes, the one for which a lower bound on the total path length is smallest is given highest priority. Prim's algorithm. 2. Using a priority queue to sort 17 *https://secweb.cs.odu.edu/~zeil/cs361/web/website/Lectures/priority Queues/pages/ar01s02.html
  • 18. 18
  • 19. 3.Bandwidth Management: Manage limited resources such as bandwidth on a transmission line from a network router. In the event of outgoing traffic queuing due to insufficient bandwidth, all other queues can be halted to send the traffic from the highest priority queue upon arrival. This ensures that the prioritized traffic (such as real-time traffic, e.g. an RTP stream of a VoIP connection) is forwarded with the least delay and the least likelihood of being rejected due to a queue reaching its maximum capacity. All other traffic can be handled when the highest priority queue is empty. Usually a limitation is set to limit the bandwidth that traffic from the highest priority queue can take, in order to prevent high priority packets from choking off all other traffic. Eg: Cisco Callmanager. 19
  • 21. 21
  • 22. 22
  • 23. 23
  • 25. 25