SlideShare a Scribd company logo
2
Most read
3
Most read
16
Most read
PRESENTED BY
  Chandramohan.R
    Manoranjani.K
      Racchana.K
    Rosalin Mary.S
 Saddam Hussain .J
Double-Ended Queue


 A Deque or deck is a double-ended queue.

 Allows elements to be added or removed on either the
 ends.
TYPES OF DEQUE
 Input restricted Deque
 Elements can be inserted only at one end.

 Elements can be removed from both the ends.



 Output restricted Deque
 Elements can be removed only at one end.

 Elements can be inserted from both the ends.
Deque as Stack and Queue
As STACK

 When insertion and deletion is made at the same side.



As Queue

 When items are inserted at one end and removed at the other
  end.
OPERATIONS IN DEQUE

 Insert element at back

 Insert element at front

 Remove element at front

 Remove element at back
Insert_front

 insert_front() is a operation used to push an element into the
  front of the Deque.

      PUSH 0           1     2       3   4       5       7




               FRONT                         REAR




                       0         1   2   3   4       5       7
Algorithm Insert_front
step1. Start
step2. Check the queue is full or not as if (r == max-1) &&(f==0)
step3. If false update the pointer f as f= f-1
step4. Insert the element at pointer f as Q[f] = element
step5. Stop
Insert_back
 insert_back() is a operation used to push an element at the
  back of a Deque.

                     1    2       3       4       5       7   PUSH 9




             FRONT                            REAR




                     1    2   3       4       5       7
Alogrithm insert_back

Step1: Start

Step2: Check the queue is full or not as if (r == max-1)
       &&(f==0) if yes queue is full

Step3: If false update the pointer r as r= r+1

Step4: Insert the element at pointer r as Q[r] = element

Step5: Stop
Remove_front

 remove_front() is a operation used to pop an element on front
  of the Deque.
            POP       1   2       3   4   5        7




                     FRONT                    REAR




                              2   3   4   5    7
Alogrithm Remove_front

Step1: Start

Step2: Check the queue is empty or not as if (f == r) if yes queue is
        empty.

Step3: If false update pointer f as f = f+1 and delete element at
        position f as element = Q[f]

Step4: If ( f== r) reset pointer f and r as f = r = -1

Step5: Stop
Remove_back
• remove_front() is a operation used to pop an element on front
of the Deque.

                     1   2       3   4   5         7    POP




                    FRONT                        REAR




                     1       2   3   4       5
Alogrithm Remove_back

step1. Start
step2. Check the queue is empty or not as if (f == r) if yes queue
                                                       is empty
step3. If false delete element at position r as element = Q[r]
step4. Update pointer r as r = r-1
step5. If (f == r ) reset pointer f and r as f = r= -1
step6. Stop
Empty

 It is used to test weather the Deque is empty or not.
APPLICATIONS OF DEQUE
Palindrome-checker
APPLICATIONS OF DEQUE
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.
OTHER APPLICATIONS OF DEQUE
 Undo-Redo operations in Software applications.
Thank You

More Related Content

PDF
Applications of stack
PPTX
Hashing
PPTX
Functions in python
PDF
Data structure ppt
PPT
Cyber security for an organization
PPT
Chapter 13 software testing strategies
PPTX
STACKS IN DATASTRUCTURE
PPTX
HyperText Transfer Protocol (HTTP)
Applications of stack
Hashing
Functions in python
Data structure ppt
Cyber security for an organization
Chapter 13 software testing strategies
STACKS IN DATASTRUCTURE
HyperText Transfer Protocol (HTTP)

What's hot (20)

PPTX
deque and it applications
PPTX
Queue - Data Structure - Notes
PPSX
Data Structure (Queue)
PPTX
Priority Queue in Data Structure
PPTX
Linked list
PPTX
Doubly Linked List
PPTX
queue & its applications
PPTX
Quick sort-Data Structure
PPTX
Graph in data structure
PDF
Searching and Sorting Techniques in Data Structure
PPT
Queue AS an ADT (Abstract Data Type)
PPTX
linked list in data structure
PPTX
PPTX
Queue ppt
PPTX
Tree Traversal
PPT
PPT
B trees in Data Structure
PPTX
PPTX
Tree traversal techniques
PPTX
Linear search-and-binary-search
deque and it applications
Queue - Data Structure - Notes
Data Structure (Queue)
Priority Queue in Data Structure
Linked list
Doubly Linked List
queue & its applications
Quick sort-Data Structure
Graph in data structure
Searching and Sorting Techniques in Data Structure
Queue AS an ADT (Abstract Data Type)
linked list in data structure
Queue ppt
Tree Traversal
B trees in Data Structure
Tree traversal techniques
Linear search-and-binary-search
Ad

Viewers also liked (20)

PPTX
Applications of queues ii
PPT
Queue data structure
PPT
Algorithm: priority queue
PPT
Priority queues
PPTX
My lectures circular queue
PPT
Queue Data Structure
PPTX
Priority queue
PDF
Queue as data_structure
PPTX
Ppt presentation of queues
PPTX
Queue Data Structure (w/ php egs)
PPSX
PPT
Notes DATA STRUCTURE - queue
PPT
Stack Data Structure & It's Application
PPT
23 priority queue
PPTX
Queue
PPT
DATA STRUCTURES
PDF
Linked List Implementation of Deque in C
PPT
Stacks, Queues, Deques
PDF
computer notes - Priority queue
Applications of queues ii
Queue data structure
Algorithm: priority queue
Priority queues
My lectures circular queue
Queue Data Structure
Priority queue
Queue as data_structure
Ppt presentation of queues
Queue Data Structure (w/ php egs)
Notes DATA STRUCTURE - queue
Stack Data Structure & It's Application
23 priority queue
Queue
DATA STRUCTURES
Linked List Implementation of Deque in C
Stacks, Queues, Deques
computer notes - Priority queue
Ad

Similar to Deque and its applications (20)

PPTX
Deque and its applications
PPTX
Stack.pptx
PPT
QUEUE OPERATIONS in DATASTRUCTURE AND ALGORITHMS
PDF
PPTX
Queue Data Structure
PPT
PPTX
PPTX
Stack and queue
PDF
Polynomialmotilalanehrunationalinstitute.pdf
PPT
Queue Data Structure
PPTX
Queue Data Structures Intro and Types of Queue
PPTX
Implementation of stacks and queues in C
PPT
Lecture 2d queues
PPT
cp264_lecture18_queue.ppt
PPTX
PPTX
Introduction to information about Data Structure.pptx
PDF
PPTX
VCE Unit 03vv.pptx
PDF
Data structure and algorithm.(dsa)
Deque and its applications
Stack.pptx
QUEUE OPERATIONS in DATASTRUCTURE AND ALGORITHMS
Queue Data Structure
Stack and queue
Polynomialmotilalanehrunationalinstitute.pdf
Queue Data Structure
Queue Data Structures Intro and Types of Queue
Implementation of stacks and queues in C
Lecture 2d queues
cp264_lecture18_queue.ppt
Introduction to information about Data Structure.pptx
VCE Unit 03vv.pptx
Data structure and algorithm.(dsa)

Recently uploaded (20)

PDF
Heart disease approach using modified random forest and particle swarm optimi...
PDF
NewMind AI Weekly Chronicles - August'25-Week II
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
Approach and Philosophy of On baking technology
PPTX
Spectroscopy.pptx food analysis technology
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
Mushroom cultivation and it's methods.pdf
PDF
Getting Started with Data Integration: FME Form 101
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
gpt5_lecture_notes_comprehensive_20250812015547.pdf
PPTX
TechTalks-8-2019-Service-Management-ITIL-Refresh-ITIL-4-Framework-Supports-Ou...
PPTX
Machine Learning_overview_presentation.pptx
PDF
A comparative analysis of optical character recognition models for extracting...
PDF
Machine learning based COVID-19 study performance prediction
PPT
Teaching material agriculture food technology
PDF
A comparative study of natural language inference in Swahili using monolingua...
PPTX
SOPHOS-XG Firewall Administrator PPT.pptx
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Heart disease approach using modified random forest and particle swarm optimi...
NewMind AI Weekly Chronicles - August'25-Week II
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Approach and Philosophy of On baking technology
Spectroscopy.pptx food analysis technology
Network Security Unit 5.pdf for BCA BBA.
Mushroom cultivation and it's methods.pdf
Getting Started with Data Integration: FME Form 101
Diabetes mellitus diagnosis method based random forest with bat algorithm
Reach Out and Touch Someone: Haptics and Empathic Computing
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
gpt5_lecture_notes_comprehensive_20250812015547.pdf
TechTalks-8-2019-Service-Management-ITIL-Refresh-ITIL-4-Framework-Supports-Ou...
Machine Learning_overview_presentation.pptx
A comparative analysis of optical character recognition models for extracting...
Machine learning based COVID-19 study performance prediction
Teaching material agriculture food technology
A comparative study of natural language inference in Swahili using monolingua...
SOPHOS-XG Firewall Administrator PPT.pptx
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf

Deque and its applications

  • 1. PRESENTED BY Chandramohan.R Manoranjani.K Racchana.K Rosalin Mary.S Saddam Hussain .J
  • 2. Double-Ended Queue  A Deque or deck is a double-ended queue.  Allows elements to be added or removed on either the ends.
  • 3. TYPES OF DEQUE  Input restricted Deque  Elements can be inserted only at one end.  Elements can be removed from both the ends.  Output restricted Deque  Elements can be removed only at one end.  Elements can be inserted from both the ends.
  • 4. Deque as Stack and Queue As STACK  When insertion and deletion is made at the same side. As Queue  When items are inserted at one end and removed at the other end.
  • 5. OPERATIONS IN DEQUE  Insert element at back  Insert element at front  Remove element at front  Remove element at back
  • 6. Insert_front  insert_front() is a operation used to push an element into the front of the Deque. PUSH 0 1 2 3 4 5 7 FRONT REAR 0 1 2 3 4 5 7
  • 7. Algorithm Insert_front step1. Start step2. Check the queue is full or not as if (r == max-1) &&(f==0) step3. If false update the pointer f as f= f-1 step4. Insert the element at pointer f as Q[f] = element step5. Stop
  • 8. Insert_back  insert_back() is a operation used to push an element at the back of a Deque. 1 2 3 4 5 7 PUSH 9 FRONT REAR 1 2 3 4 5 7
  • 9. Alogrithm insert_back Step1: Start Step2: Check the queue is full or not as if (r == max-1) &&(f==0) if yes queue is full Step3: If false update the pointer r as r= r+1 Step4: Insert the element at pointer r as Q[r] = element Step5: Stop
  • 10. Remove_front  remove_front() is a operation used to pop an element on front of the Deque. POP 1 2 3 4 5 7 FRONT REAR 2 3 4 5 7
  • 11. Alogrithm Remove_front Step1: Start Step2: Check the queue is empty or not as if (f == r) if yes queue is empty. Step3: If false update pointer f as f = f+1 and delete element at position f as element = Q[f] Step4: If ( f== r) reset pointer f and r as f = r = -1 Step5: Stop
  • 12. Remove_back • remove_front() is a operation used to pop an element on front of the Deque. 1 2 3 4 5 7 POP FRONT REAR 1 2 3 4 5
  • 13. Alogrithm Remove_back step1. Start step2. Check the queue is empty or not as if (f == r) if yes queue is empty step3. If false delete element at position r as element = Q[r] step4. Update pointer r as r = r-1 step5. If (f == r ) reset pointer f and r as f = r= -1 step6. Stop
  • 14. Empty  It is used to test weather the Deque is empty or not.
  • 16. APPLICATIONS OF DEQUE 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.
  • 17. OTHER APPLICATIONS OF DEQUE  Undo-Redo operations in Software applications.