SlideShare a Scribd company logo
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

PPTX
Network management ppt
PPTX
Chorus - Distributed Operating System [ case study ]
PPT
Chapter 12 transactions and concurrency control
PPTX
INTER PROCESS COMMUNICATION (IPC).pptx
PDF
Network security at_osi_layers
PPTX
Unix operating system
PPTX
Process creation and termination In Operating System
PPTX
Link Virtualization based on Xen
Network management ppt
Chorus - Distributed Operating System [ case study ]
Chapter 12 transactions and concurrency control
INTER PROCESS COMMUNICATION (IPC).pptx
Network security at_osi_layers
Unix operating system
Process creation and termination In Operating System
Link Virtualization based on Xen

What's hot (20)

PPT
Transaction concurrency control
PPT
Deadlock
PPTX
Operating systems unix
PPT
Chapter 3 - Processes
DOCX
PPT
Network switching
PPTX
PPTX
Unix ppt
PPTX
TCP/IP 3-way Handshake
PPT
Operating System-Threads-Galvin
PDF
Peterson’s Solution.pdf by Mustehsan Mehmood
PPTX
Operating system - Process and its concepts
DOCX
Operating System Process Synchronization
PPTX
Methods for handling deadlock
PPTX
serializability in dbms
PDF
Schedule in DBMS
PPTX
Replication in Distributed Database
PPTX
Osi model vs TCP/IP
PPT
Distributed data processing
Transaction concurrency control
Deadlock
Operating systems unix
Chapter 3 - Processes
Network switching
Unix ppt
TCP/IP 3-way Handshake
Operating System-Threads-Galvin
Peterson’s Solution.pdf by Mustehsan Mehmood
Operating system - Process and its concepts
Operating System Process Synchronization
Methods for handling deadlock
serializability in dbms
Schedule in DBMS
Replication in Distributed Database
Osi model vs TCP/IP
Distributed data processing
Ad

Viewers also liked (20)

PPTX
Deque and its applications
PPT
Queue data structure
PPTX
deque and it applications
PPTX
queue & its applications
PDF
Applications of stack
PPT
Queue Data Structure
PPT
Stack Data Structure & It's Application
PPT
Algorithm: priority queue
PDF
Queue in C, Queue Real Life of Example
PPTX
My lectures circular queue
PPTX
Ppt presentation of queues
PDF
Queue as data_structure
PPT
23 priority queue
PPT
Priority queues
PPTX
Priority queue
PPTX
Stack data structure
PPTX
First In, First Out (FIFO); Last In, Last Out (LIFO)
PPSX
PPT
Notes DATA STRUCTURE - queue
Deque and its applications
Queue data structure
deque and it applications
queue & its applications
Applications of stack
Queue Data Structure
Stack Data Structure & It's Application
Algorithm: priority queue
Queue in C, Queue Real Life of Example
My lectures circular queue
Ppt presentation of queues
Queue as data_structure
23 priority queue
Priority queues
Priority queue
Stack data structure
First In, First Out (FIFO); Last In, Last Out (LIFO)
Notes DATA STRUCTURE - queue
Ad

Similar to Applications of queues ii (20)

PPT
Queue Data Structure
PPTX
QUEUE in data-structure (classification, working procedure, Applications)
PPT
The Queue in Data structure and algorithm
PPT
Stacks and Queues concept in Data Structures
PPTX
Queue types of queue and algorithms and queue
PDF
Basic Terminologies of Queue...Basic operations on Queue
PPTX
Queues
PPTX
Queue in Data Structure
PPTX
08_Queues.pptx showing how que works given vertex
PPT
Data structure.ppt
PPT
intr_qyyuujjjjjjjkkkkkkkkkkkkkjkueue.ppt
PPT
Queues.ppt
PPTX
PPTX
apllicationsof queffffffffffffffffffffffffffffue.pptx
PPT
Chapter 4.pptmmmmmmmmmmmmmmmmmmmmmmmmmmmmm
PPT
Lecture three of datat structures ,.The Queue-ds.ppt
PPT
Queue AS an ADT (Abstract Data Type)
Queue Data Structure
QUEUE in data-structure (classification, working procedure, Applications)
The Queue in Data structure and algorithm
Stacks and Queues concept in Data Structures
Queue types of queue and algorithms and queue
Basic Terminologies of Queue...Basic operations on Queue
Queues
Queue in Data Structure
08_Queues.pptx showing how que works given vertex
Data structure.ppt
intr_qyyuujjjjjjjkkkkkkkkkkkkkjkueue.ppt
Queues.ppt
apllicationsof queffffffffffffffffffffffffffffue.pptx
Chapter 4.pptmmmmmmmmmmmmmmmmmmmmmmmmmmmmm
Lecture three of datat structures ,.The Queue-ds.ppt
Queue AS an ADT (Abstract Data Type)

More from Tech_MX (20)

PPTX
Virtual base class
PPTX
Uid
PPTX
Theory of estimation
PPTX
Templates in C++
PPT
String & its application
PPTX
Statistical quality__control_2
PPTX
Spss
PPTX
Spanning trees & applications
PPTX
Set data structure 2
PPTX
Set data structure
PPTX
Real time Operating System
PPTX
Parsing
PPTX
Mouse interrupts (Assembly Language & C)
PPT
Motherboard of a pc
PPTX
More on Lex
PPTX
MultiMedia dbms
PPTX
Merging files (Data Structure)
PPTX
Memory dbms
PPTX
Linkers
PPTX
Linear regression
Virtual base class
Uid
Theory of estimation
Templates in C++
String & its application
Statistical quality__control_2
Spss
Spanning trees & applications
Set data structure 2
Set data structure
Real time Operating System
Parsing
Mouse interrupts (Assembly Language & C)
Motherboard of a pc
More on Lex
MultiMedia dbms
Merging files (Data Structure)
Memory dbms
Linkers
Linear regression

Recently uploaded (20)

PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
Encapsulation theory and applications.pdf
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PPTX
Big Data Technologies - Introduction.pptx
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PPTX
Cloud computing and distributed systems.
PDF
MIND Revenue Release Quarter 2 2025 Press Release
PDF
Approach and Philosophy of On baking technology
PDF
Electronic commerce courselecture one. Pdf
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
Unlocking AI with Model Context Protocol (MCP)
The Rise and Fall of 3GPP – Time for a Sabbatical?
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Encapsulation theory and applications.pdf
Per capita expenditure prediction using model stacking based on satellite ima...
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
Big Data Technologies - Introduction.pptx
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
“AI and Expert System Decision Support & Business Intelligence Systems”
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Building Integrated photovoltaic BIPV_UPV.pdf
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Advanced methodologies resolving dimensionality complications for autism neur...
Cloud computing and distributed systems.
MIND Revenue Release Quarter 2 2025 Press Release
Approach and Philosophy of On baking technology
Electronic commerce courselecture one. Pdf
Mobile App Security Testing_ A Comprehensive Guide.pdf
How UI/UX Design Impacts User Retention in Mobile Apps.pdf

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