SlideShare a Scribd company logo
1 of 24
Twitter: @THATlittleJOKE
TYPES OF QUEUES

           1.               Linear Queues.


           2.                Circular Queues.


           3.               Priority Queues.

           4.                Deque.




Twitter: @THATlittleJOKE
• A priority queue is a queue in which
  insertion or deletion of items from any       PRIORITY
  position in the queue are done based on        QUEUE
  some property (such as priority of task).
   – The main objective is to serve first the
     items with higher priority.




                                                DEQUE




  Twitter: @THATlittleJOKE
METHODS OF IMPLEMENTATION

METHOD 1 :                             METHOD 2 :

• A     common         method    of
  implementation of a priority
  queue is to open as many queues
  as there are priority factors.

• A low priority queue will be
  operated for deletion only when
  all its high priority predecessors
  are empty.




    Twitter: @THATlittleJOKE
IMPLEMENTATION
                                  METHOD 1:
• ENQUEUEING

1. Each distinct priority will have a separate
   queue to have its respective elements.

2. Thus when enqueing an item, we need
   both the item and its priority to enqueue
   it in the respective queue.

3. The items will be enqueued into the
   respective queue based on their priority.



  Twitter: @THATlittleJOKE
Cont.,
                                          METHOD 1:

• DEQUEUEING

1.A dequeue command checks for items
in the queue with the highest priority.



      2.Once it is found non-empty, the item
      from it will be dequeued based on the
      FIFO concept.



             3.If the queue is empty, it moves to the
             next non-empty queue in the order and
             performs the operation.




  Twitter: @THATlittleJOKE
Cont.,
                             METHOD 1:


• The “Queue Overflow” warning will be
  thrown only when all the queues are
  found full.

• The “Queue Underflow” warning will
  be thrown only when all the queues
  are found empty.

• The implementation depends upon the
  application (TRADE OFF)


  Twitter: @THATlittleJOKE
APPLICATIONS
METHOD 1:




                   1. O.S Job Scheduling.




                   2.Sharing a single runway of an
                   airport for both landing and take-off
                   of flights.




 Twitter: @THATlittleJOKE
APPLICATION
 O.S JOB SCHEDULING:



Q1-4    A B C D

Q2-2    X Y Z                               Q

Q3-1    M N O




   Twitter: @THATlittleJOKE
APPLICATIONS



2.Sharing a single runway of an airport for
  both landing and take-off of flights.




 Twitter: @THATlittleJOKE
METHODS OF IMPLEMENTATION

METHOD 1 :                             METHOD 2 :

• A     common         method    of    • Another             method     of
  implementation of a priority           implementation could be to sort
                                         the elements in the queue
  queue is to open as many queues        according to the descending
  as there are priority factors.         order of priorities every time an
                                         insertion takes place.
• A low priority queue will be
                                       • The top priority element at the
  operated for deletion only when        head of the queue is the one to
  all its high priority predecessors     be deleted.
  are empty.




    Twitter: @THATlittleJOKE
IMPLEMENTATION
METHOD 2:


• Despite of having separate queues for
  every distinct priority, here we use only
  one queue.

• We store the items in the queue in the
  descending order of priority, thus
  making it possible with a single queue.




  Twitter: @THATlittleJOKE
IMPLEMENTATION
METHOD 2:
• ENQUEUE:

• Here too, the priority of the item is also
  needed to enqueue the item.

• The items are enqueued in the queue
  based on their priorities.

• The items are enqueued at the right
  place so that the queue retains its
  descending order.



  Twitter: @THATlittleJOKE
IMPLEMENTATION
METHOD 2:

• DEQUEUE:

• The dequeue operation is performed
  the same method as done in the linear
  queue.

• As it is the item with the highest
  priority which is at the front end, it is
  obviously the element with the highest
  priority that is being pushed out.



  Twitter: @THATlittleJOKE
IMPLEMENTATION
METHOD 2:


• The “Queue Overflow” warning will be
  thrown when the queue is found full
  (physically or procedurally).

• The “Queue Underflow” warning will
  be thrown only when the queue is
  empty.




  Twitter: @THATlittleJOKE
APPLICATIONS
METHOD 2:




                   1. Sorting.




                   2.O.S Job sharing .




 Twitter: @THATlittleJOKE
APPLICATION
SORTING:


    {(A,4),(B,2),(C,5),(D,1),(E,3)}




    A B E D
    C




 Twitter: @THATlittleJOKE
ADVANTAGES
                             METHOD 1:
                                Doesn’t incur any expensive operation (queue
                                 movement).
                             METHOD 2:
                                Consumes lesser memory.


                           DISADVANTAGES
                              METHOD  1:
                                 Consumes more memory.
                              METHOD 2:
                                 Incurs any expensive operation (queue
                                  movement).
  Eachqueue can be treated as a linear (linear or circular) queue
  Hence the usage depends on the application and its needs (TRADE OFF).



Twitter: @THATlittleJOKE
A priority queue is a queue in which
 insertion or deletion of items from any                  PRIORITY
 position in the queue are done based on                   QUEUE
 some property (such as priority of task).
   The main objective is to serve first the items with
    higher priority.


A deque (Double Ended Queue) is a
 linear list in which all insertions and
 deletions are made at the end of the list.               DEQUE




  Twitter: @THATlittleJOKE
DEQUE
 A deque is therefore more general than a
  queue and is a sort of FLIFLO (first in last in
  or first out last out). Two way insertion or
  deletion.

 Thus while one speaks of the top or
  bottom of a stack, or front or rear of a
  queue, one refers to the right end or left
  end of a deque.

 A deque has two variants: input restricted
  deque and output restricted deque.


  Twitter: @THATlittleJOKE
METHODS OF IMPLEMENTATION

TYPE 1 : INPUT RESTRICTED DEQUE      TYPE 2 : OUTPUT RESTRICTED DEQUE

 An input restricted deque is one    An output restricted deque allows
  where insertions are allowed at      insertions at both ends of the
  one end only while deletions are     deque but permits deletions only
  allowed at both ends.                at one end.




    Twitter: @THATlittleJOKE
DEQUE



IMPLEMENTATION



Twitter: @THATlittleJOKE
DEQUE



APPLICATION



Twitter: @THATlittleJOKE
Thank You…..


                           Queries..??

Twitter: @THATlittleJOKE

More Related Content

What's hot

Chapter 11 - File System Implementation
Chapter 11 - File System ImplementationChapter 11 - File System Implementation
Chapter 11 - File System ImplementationWayne Jones Jnr
 
Queue data structure
Queue data structureQueue data structure
Queue data structureanooppjoseph
 
B trees in Data Structure
B trees in Data StructureB trees in Data Structure
B trees in Data StructureAnuj Modi
 
Tower Of Hanoi -A MatheMatical PuZzle
Tower Of Hanoi -A MatheMatical PuZzleTower Of Hanoi -A MatheMatical PuZzle
Tower Of Hanoi -A MatheMatical PuZzlepurvanahar
 
SEARCHING AND SORTING ALGORITHMS
SEARCHING AND SORTING ALGORITHMSSEARCHING AND SORTING ALGORITHMS
SEARCHING AND SORTING ALGORITHMSGokul Hari
 
Systemtap
SystemtapSystemtap
SystemtapFeng Yu
 
Binary Search Tree
Binary Search TreeBinary Search Tree
Binary Search TreeAbhishek L.R
 
Hashing In Data Structure
Hashing In Data Structure Hashing In Data Structure
Hashing In Data Structure Meghaj Mallick
 
Quick Sort , Merge Sort , Heap Sort
Quick Sort , Merge Sort ,  Heap SortQuick Sort , Merge Sort ,  Heap Sort
Quick Sort , Merge Sort , Heap SortMohammed Hussein
 
Analysis of Algorithm (Bubblesort and Quicksort)
Analysis of Algorithm (Bubblesort and Quicksort)Analysis of Algorithm (Bubblesort and Quicksort)
Analysis of Algorithm (Bubblesort and Quicksort)Flynce Miguel
 
Priority Queue in Data Structure
Priority Queue in Data StructurePriority Queue in Data Structure
Priority Queue in Data StructureMeghaj Mallick
 

What's hot (20)

Stack
StackStack
Stack
 
10 File System
10 File System10 File System
10 File System
 
Chapter 11 - File System Implementation
Chapter 11 - File System ImplementationChapter 11 - File System Implementation
Chapter 11 - File System Implementation
 
Heap sort
Heap sortHeap sort
Heap sort
 
Stack a Data Structure
Stack a Data StructureStack a Data Structure
Stack a Data Structure
 
Unit 4 queue
Unit   4 queueUnit   4 queue
Unit 4 queue
 
Memory Management
Memory ManagementMemory Management
Memory Management
 
Queue data structure
Queue data structureQueue data structure
Queue data structure
 
B trees in Data Structure
B trees in Data StructureB trees in Data Structure
B trees in Data Structure
 
Tower Of Hanoi -A MatheMatical PuZzle
Tower Of Hanoi -A MatheMatical PuZzleTower Of Hanoi -A MatheMatical PuZzle
Tower Of Hanoi -A MatheMatical PuZzle
 
SEARCHING AND SORTING ALGORITHMS
SEARCHING AND SORTING ALGORITHMSSEARCHING AND SORTING ALGORITHMS
SEARCHING AND SORTING ALGORITHMS
 
Systemtap
SystemtapSystemtap
Systemtap
 
Binary Tree Traversal
Binary Tree TraversalBinary Tree Traversal
Binary Tree Traversal
 
05 multiply divide
05 multiply divide05 multiply divide
05 multiply divide
 
Binary Search Tree
Binary Search TreeBinary Search Tree
Binary Search Tree
 
Hashing In Data Structure
Hashing In Data Structure Hashing In Data Structure
Hashing In Data Structure
 
Quick Sort , Merge Sort , Heap Sort
Quick Sort , Merge Sort ,  Heap SortQuick Sort , Merge Sort ,  Heap Sort
Quick Sort , Merge Sort , Heap Sort
 
Analysis of Algorithm (Bubblesort and Quicksort)
Analysis of Algorithm (Bubblesort and Quicksort)Analysis of Algorithm (Bubblesort and Quicksort)
Analysis of Algorithm (Bubblesort and Quicksort)
 
Priority Queue in Data Structure
Priority Queue in Data StructurePriority Queue in Data Structure
Priority Queue in Data Structure
 
Binary trees1
Binary trees1Binary trees1
Binary trees1
 

Viewers also liked

Deque and its applications
Deque and its applicationsDeque and its applications
Deque and its applicationsJsaddam Hussain
 
Applications of stack
Applications of stackApplications of stack
Applications of stackeShikshak
 
Queue Data Structure
Queue Data StructureQueue Data Structure
Queue Data StructureZidny Nafan
 
Stack Data Structure & It's Application
Stack Data Structure & It's Application Stack Data Structure & It's Application
Stack Data Structure & It's Application Tech_MX
 
Algorithm: priority queue
Algorithm: priority queueAlgorithm: priority queue
Algorithm: priority queueTareq Hasan
 
Queue in C, Queue Real Life of Example
Queue in C, Queue Real Life of ExampleQueue in C, Queue Real Life of Example
Queue in C, Queue Real Life of ExampleHitesh Kumar
 
My lectures circular queue
My lectures circular queueMy lectures circular queue
My lectures circular queueSenthil Kumar
 
Ppt presentation of queues
Ppt presentation of queuesPpt presentation of queues
Ppt presentation of queuesBuxoo Abdullah
 
Queue as data_structure
Queue as data_structureQueue as data_structure
Queue as data_structureeShikshak
 
23 priority queue
23 priority queue23 priority queue
23 priority queueGodo Dodo
 
First In, First Out (FIFO); Last In, Last Out (LIFO)
First In, First Out (FIFO); Last In, Last Out (LIFO)First In, First Out (FIFO); Last In, Last Out (LIFO)
First In, First Out (FIFO); Last In, Last Out (LIFO)UNowAcademics
 
Notes DATA STRUCTURE - queue
Notes DATA STRUCTURE - queueNotes DATA STRUCTURE - queue
Notes DATA STRUCTURE - queueFarhanum Aziera
 
Large-scale projects development (scaling LAMP)
Large-scale projects development (scaling LAMP)Large-scale projects development (scaling LAMP)
Large-scale projects development (scaling LAMP)Alexey Rybak
 
Applicationof datastructures
Applicationof datastructuresApplicationof datastructures
Applicationof datastructuresHitesh Wagle
 

Viewers also liked (20)

Deque and its applications
Deque and its applicationsDeque and its applications
Deque and its applications
 
deque and it applications
deque and it applicationsdeque and it applications
deque and it applications
 
Applications of stack
Applications of stackApplications of stack
Applications of stack
 
Queue Data Structure
Queue Data StructureQueue Data Structure
Queue Data Structure
 
Stack Data Structure & It's Application
Stack Data Structure & It's Application Stack Data Structure & It's Application
Stack Data Structure & It's Application
 
Algorithm: priority queue
Algorithm: priority queueAlgorithm: priority queue
Algorithm: priority queue
 
Queue in C, Queue Real Life of Example
Queue in C, Queue Real Life of ExampleQueue in C, Queue Real Life of Example
Queue in C, Queue Real Life of Example
 
My lectures circular queue
My lectures circular queueMy lectures circular queue
My lectures circular queue
 
Ppt presentation of queues
Ppt presentation of queuesPpt presentation of queues
Ppt presentation of queues
 
Stack Applications
Stack ApplicationsStack Applications
Stack Applications
 
Queue as data_structure
Queue as data_structureQueue as data_structure
Queue as data_structure
 
23 priority queue
23 priority queue23 priority queue
23 priority queue
 
Priority queues
Priority queuesPriority queues
Priority queues
 
Priority queue
Priority queuePriority queue
Priority queue
 
First In, First Out (FIFO); Last In, Last Out (LIFO)
First In, First Out (FIFO); Last In, Last Out (LIFO)First In, First Out (FIFO); Last In, Last Out (LIFO)
First In, First Out (FIFO); Last In, Last Out (LIFO)
 
Stack
StackStack
Stack
 
Notes DATA STRUCTURE - queue
Notes DATA STRUCTURE - queueNotes DATA STRUCTURE - queue
Notes DATA STRUCTURE - queue
 
Large-scale projects development (scaling LAMP)
Large-scale projects development (scaling LAMP)Large-scale projects development (scaling LAMP)
Large-scale projects development (scaling LAMP)
 
Applicationof datastructures
Applicationof datastructuresApplicationof datastructures
Applicationof datastructures
 
U3.stack queue
U3.stack queueU3.stack queue
U3.stack queue
 

More from Tech_MX

Virtual base class
Virtual base classVirtual base class
Virtual base classTech_MX
 
Theory of estimation
Theory of estimationTheory of estimation
Theory of estimationTech_MX
 
Templates in C++
Templates in C++Templates in C++
Templates in C++Tech_MX
 
String & its application
String & its applicationString & its application
String & its applicationTech_MX
 
Statistical quality__control_2
Statistical  quality__control_2Statistical  quality__control_2
Statistical quality__control_2Tech_MX
 
Spanning trees & applications
Spanning trees & applicationsSpanning trees & applications
Spanning trees & applicationsTech_MX
 
Set data structure 2
Set data structure 2Set data structure 2
Set data structure 2Tech_MX
 
Set data structure
Set data structure Set data structure
Set data structure Tech_MX
 
Real time Operating System
Real time Operating SystemReal time Operating System
Real time Operating SystemTech_MX
 
Mouse interrupts (Assembly Language & C)
Mouse interrupts (Assembly Language & C)Mouse interrupts (Assembly Language & C)
Mouse interrupts (Assembly Language & C)Tech_MX
 
Motherboard of a pc
Motherboard of a pcMotherboard of a pc
Motherboard of a pcTech_MX
 
More on Lex
More on LexMore on Lex
More on LexTech_MX
 
MultiMedia dbms
MultiMedia dbmsMultiMedia dbms
MultiMedia dbmsTech_MX
 
Merging files (Data Structure)
Merging files (Data Structure)Merging files (Data Structure)
Merging files (Data Structure)Tech_MX
 
Memory dbms
Memory dbmsMemory dbms
Memory dbmsTech_MX
 
Linear regression
Linear regressionLinear regression
Linear regressionTech_MX
 

More from Tech_MX (20)

Virtual base class
Virtual base classVirtual base class
Virtual base class
 
Uid
UidUid
Uid
 
Theory of estimation
Theory of estimationTheory of estimation
Theory of estimation
 
Templates in C++
Templates in C++Templates in C++
Templates in C++
 
String & its application
String & its applicationString & its application
String & its application
 
Statistical quality__control_2
Statistical  quality__control_2Statistical  quality__control_2
Statistical quality__control_2
 
Spss
SpssSpss
Spss
 
Spanning trees & applications
Spanning trees & applicationsSpanning trees & applications
Spanning trees & applications
 
Set data structure 2
Set data structure 2Set data structure 2
Set data structure 2
 
Set data structure
Set data structure Set data structure
Set data structure
 
Real time Operating System
Real time Operating SystemReal time Operating System
Real time Operating System
 
Parsing
ParsingParsing
Parsing
 
Mouse interrupts (Assembly Language & C)
Mouse interrupts (Assembly Language & C)Mouse interrupts (Assembly Language & C)
Mouse interrupts (Assembly Language & C)
 
Motherboard of a pc
Motherboard of a pcMotherboard of a pc
Motherboard of a pc
 
More on Lex
More on LexMore on Lex
More on Lex
 
MultiMedia dbms
MultiMedia dbmsMultiMedia dbms
MultiMedia dbms
 
Merging files (Data Structure)
Merging files (Data Structure)Merging files (Data Structure)
Merging files (Data Structure)
 
Memory dbms
Memory dbmsMemory dbms
Memory dbms
 
Linkers
LinkersLinkers
Linkers
 
Linear regression
Linear regressionLinear regression
Linear regression
 

Recently uploaded

The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersRaghuram Pandurangan
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfPrecisely
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 

Recently uploaded (20)

The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information Developers
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 

Applications of queues ii

  • 2. TYPES OF QUEUES 1. Linear Queues. 2. Circular Queues. 3. Priority Queues. 4. Deque. Twitter: @THATlittleJOKE
  • 3. • A priority queue is a queue in which insertion or deletion of items from any PRIORITY position in the queue are done based on QUEUE some property (such as priority of task). – The main objective is to serve first the items with higher priority. DEQUE Twitter: @THATlittleJOKE
  • 4. METHODS OF IMPLEMENTATION METHOD 1 : METHOD 2 : • A common method of implementation of a priority queue is to open as many queues as there are priority factors. • A low priority queue will be operated for deletion only when all its high priority predecessors are empty. Twitter: @THATlittleJOKE
  • 5. IMPLEMENTATION METHOD 1: • ENQUEUEING 1. Each distinct priority will have a separate queue to have its respective elements. 2. Thus when enqueing an item, we need both the item and its priority to enqueue it in the respective queue. 3. The items will be enqueued into the respective queue based on their priority. Twitter: @THATlittleJOKE
  • 6. Cont., METHOD 1: • DEQUEUEING 1.A dequeue command checks for items in the queue with the highest priority. 2.Once it is found non-empty, the item from it will be dequeued based on the FIFO concept. 3.If the queue is empty, it moves to the next non-empty queue in the order and performs the operation. Twitter: @THATlittleJOKE
  • 7. Cont., METHOD 1: • The “Queue Overflow” warning will be thrown only when all the queues are found full. • The “Queue Underflow” warning will be thrown only when all the queues are found empty. • The implementation depends upon the application (TRADE OFF) Twitter: @THATlittleJOKE
  • 8. APPLICATIONS METHOD 1: 1. O.S Job Scheduling. 2.Sharing a single runway of an airport for both landing and take-off of flights. Twitter: @THATlittleJOKE
  • 9. APPLICATION O.S JOB SCHEDULING: Q1-4 A B C D Q2-2 X Y Z Q Q3-1 M N O Twitter: @THATlittleJOKE
  • 10. APPLICATIONS 2.Sharing a single runway of an airport for both landing and take-off of flights. Twitter: @THATlittleJOKE
  • 11. METHODS OF IMPLEMENTATION METHOD 1 : METHOD 2 : • A common method of • Another method of implementation of a priority implementation could be to sort the elements in the queue queue is to open as many queues according to the descending as there are priority factors. order of priorities every time an insertion takes place. • A low priority queue will be • The top priority element at the operated for deletion only when head of the queue is the one to all its high priority predecessors be deleted. are empty. Twitter: @THATlittleJOKE
  • 12. IMPLEMENTATION METHOD 2: • Despite of having separate queues for every distinct priority, here we use only one queue. • We store the items in the queue in the descending order of priority, thus making it possible with a single queue. Twitter: @THATlittleJOKE
  • 13. IMPLEMENTATION METHOD 2: • ENQUEUE: • Here too, the priority of the item is also needed to enqueue the item. • The items are enqueued in the queue based on their priorities. • The items are enqueued at the right place so that the queue retains its descending order. Twitter: @THATlittleJOKE
  • 14. IMPLEMENTATION METHOD 2: • DEQUEUE: • The dequeue operation is performed the same method as done in the linear queue. • As it is the item with the highest priority which is at the front end, it is obviously the element with the highest priority that is being pushed out. Twitter: @THATlittleJOKE
  • 15. IMPLEMENTATION METHOD 2: • The “Queue Overflow” warning will be thrown when the queue is found full (physically or procedurally). • The “Queue Underflow” warning will be thrown only when the queue is empty. Twitter: @THATlittleJOKE
  • 16. APPLICATIONS METHOD 2: 1. Sorting. 2.O.S Job sharing . Twitter: @THATlittleJOKE
  • 17. APPLICATION SORTING: {(A,4),(B,2),(C,5),(D,1),(E,3)} A B E D C Twitter: @THATlittleJOKE
  • 18. ADVANTAGES  METHOD 1:  Doesn’t incur any expensive operation (queue movement).  METHOD 2:  Consumes lesser memory. DISADVANTAGES  METHOD 1:  Consumes more memory.  METHOD 2:  Incurs any expensive operation (queue movement).  Eachqueue can be treated as a linear (linear or circular) queue  Hence the usage depends on the application and its needs (TRADE OFF). Twitter: @THATlittleJOKE
  • 19. A priority queue is a queue in which insertion or deletion of items from any PRIORITY position in the queue are done based on QUEUE some property (such as priority of task). The main objective is to serve first the items with higher priority. A deque (Double Ended Queue) is a linear list in which all insertions and deletions are made at the end of the list. DEQUE Twitter: @THATlittleJOKE
  • 20. DEQUE  A deque is therefore more general than a queue and is a sort of FLIFLO (first in last in or first out last out). Two way insertion or deletion.  Thus while one speaks of the top or bottom of a stack, or front or rear of a queue, one refers to the right end or left end of a deque.  A deque has two variants: input restricted deque and output restricted deque. Twitter: @THATlittleJOKE
  • 21. METHODS OF IMPLEMENTATION TYPE 1 : INPUT RESTRICTED DEQUE TYPE 2 : OUTPUT RESTRICTED DEQUE  An input restricted deque is one  An output restricted deque allows where insertions are allowed at insertions at both ends of the one end only while deletions are deque but permits deletions only allowed at both ends. at one end. Twitter: @THATlittleJOKE
  • 24. Thank You….. Queries..?? Twitter: @THATlittleJOKE