SlideShare a Scribd company logo
1 of 19
DEQUE
 Deque (short form of double-ended queue) is a
linear list in which elements can be inserted or
deleted at either end but not in the middle.
 That is, elements can be inserted/deleted to/ from
the rear or the front end.
 Figure 4.9 shows the representation of a deque.
DEQUE
#define MAX 30
typedef struct dequeue
{
int data[MAX];
int rear,front;
}dequeue;
DEQUE
 void initialize(dequeue *p);
 int empty(dequeue *p);
 int full(dequeue *p);
 void enqueueR(dequeue *p,int x);
 void enqueueF(dequeue *p,int x);
 int dequeueF(dequeue *p);
 int dequeueR(dequeue *p);
 void print(dequeue *p);
DEQUE
 void initialize(dequeue *p);
 int empty(dequeue *p);
 int full(dequeue *p);
 void enqueueR(dequeue *p,int x);
 void enqueueF(dequeue *p,int x);
 int dequeueF(dequeue *p);
 int dequeueR(dequeue *p);
 void print(dequeue *p);
DEQUE
void initialize(dequeue *P)
{
P->rear=-1;
P->front=-1;
}
DEQUE
 void initialize(dequeue *p);
 int empty(dequeue *p);
 int full(dequeue *p);
 void enqueueR(dequeue *p,int x);
 void enqueueF(dequeue *p,int x);
 int dequeueF(dequeue *p);
 int dequeueR(dequeue *p);
 void print(dequeue *p);
DEQUE
int empty(dequeue *P)
{
if(P->rear==-1)
return(1);
return(0);
}
int full(dequeue *P)
{
if((P->rear+1)%MAX==P->front)
return(1);
return(0);
}
DEQUE
 void initialize(dequeue *p);
 int empty(dequeue *p);
 int full(dequeue *p);
 void enqueueR(dequeue *p,int x);
 void enqueueF(dequeue *p,int x);
 int dequeueF(dequeue *p);
 int dequeueR(dequeue *p);
 void print(dequeue *p);
DEQUE
void enqueueR(dequeue *P, int x)
{
if(empty(P))
{
P->rear=0; P->front=0;
P->data[0]=x;
}
else
{
P->rear=(P->rear+1)%MAX;
P->data[P->rear]=x;
}
}
DEQUE
 void initialize(dequeue *p);
 int empty(dequeue *p);
 int full(dequeue *p);
 void enqueueR(dequeue *p,int x);
 void enqueueF(dequeue *p,int x);
 int dequeueF(dequeue *p);
 int dequeueR(dequeue *p);
 void print(dequeue *p);
DEQUE
void enqueueF(dequeue *P, int x)
{
if(empty(P))
{
P->rear=0; P->front=0;
P->data[0]=x;
}
else
{
P->front=(P->front-1+MAX)%MAX;
P->data[P->front]=x;
}
}
DEQUE
 void initialize(dequeue *p);
 int empty(dequeue *p);
 int full(dequeue *p);
 void enqueueR(dequeue *p,int x);
 void enqueueF(dequeue *p,int x);
 int dequeueF(dequeue *p);
 int dequeueR(dequeue *p);
 void print(dequeue *p);
DEQUE
int dequeueF(dequeue *P)
{
int x;
x=P->data[P->front];
if(P->rear==P->front) /*delete the last element
*/
initialize(P);
else
P->front=(P->front+1)%MAX;
return(x);
}
DEQUE
 void initialize(dequeue *p);
 int empty(dequeue *p);
 int full(dequeue *p);
 void enqueueR(dequeue *p,int x);
 void enqueueF(dequeue *p,int x);
 int dequeueF(dequeue *p);
 int dequeueR(dequeue *p);
 void print(dequeue *p);
DEQUE
int dequeueR(dequeue *P)
{
int x;
x=P->data[P->rear];
if(P->rear==P->front)
initialize(P);
else
P->rear=(P->rear-1+MAX)%MAX;
return(x);
}
DEQUE
 void initialize(dequeue *p);
 int empty(dequeue *p);
 int full(dequeue *p);
 void enqueueR(dequeue *p,int x);
 void enqueueF(dequeue *p,int x);
 int dequeueF(dequeue *p);
 int dequeueR(dequeue *p);
 void print(dequeue *p);
DEQUE
void print(dequeue *P)
{
if(empty(P))
{
printf("nQueue is empty!!"); exit(0);
}
int i ; i=P->front;
while(i!=P->rear)
{
printf("n%d",P->data[i]); i=(i+1)%MAX;
}
printf("n%dn",P->data[P->rear]);
}
REFER
DS Lab Manual for complete program
VARIATIONS OF DEQUE
 There are two variations of a deque that are as follows:
(1)Input restricted deque: It allows insertion of elements at one
end only but deletion can be done at both ends.
(2)Output restricted deque: It allows deletion of elements at
one end only but insertion can be done at both ends.
 The implementation of both these queues is similar to the
implementation of deque. The only difference is that in input
restricted queue, function for insertion in the beginning is not
needed whereas in output-restricted queue, function for deletion
in the beginning is not needed.

More Related Content

Similar to Dequeue.ppt

lab08build.bat@echo offclsset DRIVE_LETTER=1s.docx
lab08build.bat@echo offclsset DRIVE_LETTER=1s.docxlab08build.bat@echo offclsset DRIVE_LETTER=1s.docx
lab08build.bat@echo offclsset DRIVE_LETTER=1s.docxDIPESH30
 
Datastructures asignment
Datastructures asignmentDatastructures asignment
Datastructures asignmentsreekanth3dce
 
Implementing Virtual Machines in Go & C
Implementing Virtual Machines in Go & CImplementing Virtual Machines in Go & C
Implementing Virtual Machines in Go & CEleanor McHugh
 
Solutionsfor co2 C Programs for data structures
Solutionsfor co2 C Programs for data structuresSolutionsfor co2 C Programs for data structures
Solutionsfor co2 C Programs for data structuresLakshmi Sarvani Videla
 
Implementing Software Machines in Go and C
Implementing Software Machines in Go and CImplementing Software Machines in Go and C
Implementing Software Machines in Go and CEleanor McHugh
 
Sorting programs
Sorting programsSorting programs
Sorting programsVarun Garg
 
#includeiostream#includestdlib.husing namespace std;class .pdf
#includeiostream#includestdlib.husing namespace std;class .pdf#includeiostream#includestdlib.husing namespace std;class .pdf
#includeiostream#includestdlib.husing namespace std;class .pdfasif1401
 
Data Structures Using C Practical File
Data Structures Using C Practical File Data Structures Using C Practical File
Data Structures Using C Practical File Rahul Chugh
 
Write a program that accepts an arithmetic expression of unsigned in.pdf
Write a program that accepts an arithmetic expression of unsigned in.pdfWrite a program that accepts an arithmetic expression of unsigned in.pdf
Write a program that accepts an arithmetic expression of unsigned in.pdfJUSTSTYLISH3B2MOHALI
 
Link list part 2
Link list part 2Link list part 2
Link list part 2Anaya Zafar
 

Similar to Dequeue.ppt (20)

Stack queue
Stack queueStack queue
Stack queue
 
Stack queue
Stack queueStack queue
Stack queue
 
Stack queue
Stack queueStack queue
Stack queue
 
Stack queue
Stack queueStack queue
Stack queue
 
Stack queue
Stack queueStack queue
Stack queue
 
lab08build.bat@echo offclsset DRIVE_LETTER=1s.docx
lab08build.bat@echo offclsset DRIVE_LETTER=1s.docxlab08build.bat@echo offclsset DRIVE_LETTER=1s.docx
lab08build.bat@echo offclsset DRIVE_LETTER=1s.docx
 
Datastructures asignment
Datastructures asignmentDatastructures asignment
Datastructures asignment
 
week-15x
week-15xweek-15x
week-15x
 
Implementing Virtual Machines in Go & C
Implementing Virtual Machines in Go & CImplementing Virtual Machines in Go & C
Implementing Virtual Machines in Go & C
 
Solutionsfor co2 C Programs for data structures
Solutionsfor co2 C Programs for data structuresSolutionsfor co2 C Programs for data structures
Solutionsfor co2 C Programs for data structures
 
Implementing Software Machines in Go and C
Implementing Software Machines in Go and CImplementing Software Machines in Go and C
Implementing Software Machines in Go and C
 
Blocks+gcd入門
Blocks+gcd入門Blocks+gcd入門
Blocks+gcd入門
 
week-18x
week-18xweek-18x
week-18x
 
week-17x
week-17xweek-17x
week-17x
 
Sorting programs
Sorting programsSorting programs
Sorting programs
 
Pointer
PointerPointer
Pointer
 
#includeiostream#includestdlib.husing namespace std;class .pdf
#includeiostream#includestdlib.husing namespace std;class .pdf#includeiostream#includestdlib.husing namespace std;class .pdf
#includeiostream#includestdlib.husing namespace std;class .pdf
 
Data Structures Using C Practical File
Data Structures Using C Practical File Data Structures Using C Practical File
Data Structures Using C Practical File
 
Write a program that accepts an arithmetic expression of unsigned in.pdf
Write a program that accepts an arithmetic expression of unsigned in.pdfWrite a program that accepts an arithmetic expression of unsigned in.pdf
Write a program that accepts an arithmetic expression of unsigned in.pdf
 
Link list part 2
Link list part 2Link list part 2
Link list part 2
 

Recently uploaded

Vector Search @ sw2con for slideshare.pptx
Vector Search @ sw2con for slideshare.pptxVector Search @ sw2con for slideshare.pptx
Vector Search @ sw2con for slideshare.pptxjbellis
 
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptx
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptxHarnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptx
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptxFIDO Alliance
 
Human Expert Website Manual WCAG 2.0 2.1 2.2 Audit - Digital Accessibility Au...
Human Expert Website Manual WCAG 2.0 2.1 2.2 Audit - Digital Accessibility Au...Human Expert Website Manual WCAG 2.0 2.1 2.2 Audit - Digital Accessibility Au...
Human Expert Website Manual WCAG 2.0 2.1 2.2 Audit - Digital Accessibility Au...Skynet Technologies
 
Using IESVE for Room Loads Analysis - UK & Ireland
Using IESVE for Room Loads Analysis - UK & IrelandUsing IESVE for Room Loads Analysis - UK & Ireland
Using IESVE for Room Loads Analysis - UK & IrelandIES VE
 
TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...
TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...
TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...marcuskenyatta275
 
Google I/O Extended 2024 Warsaw
Google I/O Extended 2024 WarsawGoogle I/O Extended 2024 Warsaw
Google I/O Extended 2024 WarsawGDSC PJATK
 
Revolutionizing SAP® Processes with Automation and Artificial Intelligence
Revolutionizing SAP® Processes with Automation and Artificial IntelligenceRevolutionizing SAP® Processes with Automation and Artificial Intelligence
Revolutionizing SAP® Processes with Automation and Artificial IntelligencePrecisely
 
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...panagenda
 
Design Guidelines for Passkeys 2024.pptx
Design Guidelines for Passkeys 2024.pptxDesign Guidelines for Passkeys 2024.pptx
Design Guidelines for Passkeys 2024.pptxFIDO Alliance
 
Event-Driven Architecture Masterclass: Engineering a Robust, High-performance...
Event-Driven Architecture Masterclass: Engineering a Robust, High-performance...Event-Driven Architecture Masterclass: Engineering a Robust, High-performance...
Event-Driven Architecture Masterclass: Engineering a Robust, High-performance...ScyllaDB
 
Frisco Automating Purchase Orders with MuleSoft IDP- May 10th, 2024.pptx.pdf
Frisco Automating Purchase Orders with MuleSoft IDP- May 10th, 2024.pptx.pdfFrisco Automating Purchase Orders with MuleSoft IDP- May 10th, 2024.pptx.pdf
Frisco Automating Purchase Orders with MuleSoft IDP- May 10th, 2024.pptx.pdfAnubhavMangla3
 
TopCryptoSupers 12thReport OrionX May2024
TopCryptoSupers 12thReport OrionX May2024TopCryptoSupers 12thReport OrionX May2024
TopCryptoSupers 12thReport OrionX May2024Stephen Perrenod
 
“Iamnobody89757” Understanding the Mysterious of Digital Identity.pdf
“Iamnobody89757” Understanding the Mysterious of Digital Identity.pdf“Iamnobody89757” Understanding the Mysterious of Digital Identity.pdf
“Iamnobody89757” Understanding the Mysterious of Digital Identity.pdfMuhammad Subhan
 
Hyatt driving innovation and exceptional customer experiences with FIDO passw...
Hyatt driving innovation and exceptional customer experiences with FIDO passw...Hyatt driving innovation and exceptional customer experiences with FIDO passw...
Hyatt driving innovation and exceptional customer experiences with FIDO passw...FIDO Alliance
 
The Metaverse: Are We There Yet?
The  Metaverse:    Are   We  There  Yet?The  Metaverse:    Are   We  There  Yet?
The Metaverse: Are We There Yet?Mark Billinghurst
 
ADP Passwordless Journey Case Study.pptx
ADP Passwordless Journey Case Study.pptxADP Passwordless Journey Case Study.pptx
ADP Passwordless Journey Case Study.pptxFIDO Alliance
 
Generative AI Use Cases and Applications.pdf
Generative AI Use Cases and Applications.pdfGenerative AI Use Cases and Applications.pdf
Generative AI Use Cases and Applications.pdfalexjohnson7307
 
Observability Concepts EVERY Developer Should Know (DevOpsDays Seattle)
Observability Concepts EVERY Developer Should Know (DevOpsDays Seattle)Observability Concepts EVERY Developer Should Know (DevOpsDays Seattle)
Observability Concepts EVERY Developer Should Know (DevOpsDays Seattle)Paige Cruz
 
ChatGPT and Beyond - Elevating DevOps Productivity
ChatGPT and Beyond - Elevating DevOps ProductivityChatGPT and Beyond - Elevating DevOps Productivity
ChatGPT and Beyond - Elevating DevOps ProductivityVictorSzoltysek
 
(Explainable) Data-Centric AI: what are you explaininhg, and to whom?
(Explainable) Data-Centric AI: what are you explaininhg, and to whom?(Explainable) Data-Centric AI: what are you explaininhg, and to whom?
(Explainable) Data-Centric AI: what are you explaininhg, and to whom?Paolo Missier
 

Recently uploaded (20)

Vector Search @ sw2con for slideshare.pptx
Vector Search @ sw2con for slideshare.pptxVector Search @ sw2con for slideshare.pptx
Vector Search @ sw2con for slideshare.pptx
 
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptx
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptxHarnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptx
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptx
 
Human Expert Website Manual WCAG 2.0 2.1 2.2 Audit - Digital Accessibility Au...
Human Expert Website Manual WCAG 2.0 2.1 2.2 Audit - Digital Accessibility Au...Human Expert Website Manual WCAG 2.0 2.1 2.2 Audit - Digital Accessibility Au...
Human Expert Website Manual WCAG 2.0 2.1 2.2 Audit - Digital Accessibility Au...
 
Using IESVE for Room Loads Analysis - UK & Ireland
Using IESVE for Room Loads Analysis - UK & IrelandUsing IESVE for Room Loads Analysis - UK & Ireland
Using IESVE for Room Loads Analysis - UK & Ireland
 
TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...
TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...
TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...
 
Google I/O Extended 2024 Warsaw
Google I/O Extended 2024 WarsawGoogle I/O Extended 2024 Warsaw
Google I/O Extended 2024 Warsaw
 
Revolutionizing SAP® Processes with Automation and Artificial Intelligence
Revolutionizing SAP® Processes with Automation and Artificial IntelligenceRevolutionizing SAP® Processes with Automation and Artificial Intelligence
Revolutionizing SAP® Processes with Automation and Artificial Intelligence
 
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
 
Design Guidelines for Passkeys 2024.pptx
Design Guidelines for Passkeys 2024.pptxDesign Guidelines for Passkeys 2024.pptx
Design Guidelines for Passkeys 2024.pptx
 
Event-Driven Architecture Masterclass: Engineering a Robust, High-performance...
Event-Driven Architecture Masterclass: Engineering a Robust, High-performance...Event-Driven Architecture Masterclass: Engineering a Robust, High-performance...
Event-Driven Architecture Masterclass: Engineering a Robust, High-performance...
 
Frisco Automating Purchase Orders with MuleSoft IDP- May 10th, 2024.pptx.pdf
Frisco Automating Purchase Orders with MuleSoft IDP- May 10th, 2024.pptx.pdfFrisco Automating Purchase Orders with MuleSoft IDP- May 10th, 2024.pptx.pdf
Frisco Automating Purchase Orders with MuleSoft IDP- May 10th, 2024.pptx.pdf
 
TopCryptoSupers 12thReport OrionX May2024
TopCryptoSupers 12thReport OrionX May2024TopCryptoSupers 12thReport OrionX May2024
TopCryptoSupers 12thReport OrionX May2024
 
“Iamnobody89757” Understanding the Mysterious of Digital Identity.pdf
“Iamnobody89757” Understanding the Mysterious of Digital Identity.pdf“Iamnobody89757” Understanding the Mysterious of Digital Identity.pdf
“Iamnobody89757” Understanding the Mysterious of Digital Identity.pdf
 
Hyatt driving innovation and exceptional customer experiences with FIDO passw...
Hyatt driving innovation and exceptional customer experiences with FIDO passw...Hyatt driving innovation and exceptional customer experiences with FIDO passw...
Hyatt driving innovation and exceptional customer experiences with FIDO passw...
 
The Metaverse: Are We There Yet?
The  Metaverse:    Are   We  There  Yet?The  Metaverse:    Are   We  There  Yet?
The Metaverse: Are We There Yet?
 
ADP Passwordless Journey Case Study.pptx
ADP Passwordless Journey Case Study.pptxADP Passwordless Journey Case Study.pptx
ADP Passwordless Journey Case Study.pptx
 
Generative AI Use Cases and Applications.pdf
Generative AI Use Cases and Applications.pdfGenerative AI Use Cases and Applications.pdf
Generative AI Use Cases and Applications.pdf
 
Observability Concepts EVERY Developer Should Know (DevOpsDays Seattle)
Observability Concepts EVERY Developer Should Know (DevOpsDays Seattle)Observability Concepts EVERY Developer Should Know (DevOpsDays Seattle)
Observability Concepts EVERY Developer Should Know (DevOpsDays Seattle)
 
ChatGPT and Beyond - Elevating DevOps Productivity
ChatGPT and Beyond - Elevating DevOps ProductivityChatGPT and Beyond - Elevating DevOps Productivity
ChatGPT and Beyond - Elevating DevOps Productivity
 
(Explainable) Data-Centric AI: what are you explaininhg, and to whom?
(Explainable) Data-Centric AI: what are you explaininhg, and to whom?(Explainable) Data-Centric AI: what are you explaininhg, and to whom?
(Explainable) Data-Centric AI: what are you explaininhg, and to whom?
 

Dequeue.ppt

  • 1. DEQUE  Deque (short form of double-ended queue) is a linear list in which elements can be inserted or deleted at either end but not in the middle.  That is, elements can be inserted/deleted to/ from the rear or the front end.  Figure 4.9 shows the representation of a deque.
  • 2. DEQUE #define MAX 30 typedef struct dequeue { int data[MAX]; int rear,front; }dequeue;
  • 3. DEQUE  void initialize(dequeue *p);  int empty(dequeue *p);  int full(dequeue *p);  void enqueueR(dequeue *p,int x);  void enqueueF(dequeue *p,int x);  int dequeueF(dequeue *p);  int dequeueR(dequeue *p);  void print(dequeue *p);
  • 4. DEQUE  void initialize(dequeue *p);  int empty(dequeue *p);  int full(dequeue *p);  void enqueueR(dequeue *p,int x);  void enqueueF(dequeue *p,int x);  int dequeueF(dequeue *p);  int dequeueR(dequeue *p);  void print(dequeue *p);
  • 6. DEQUE  void initialize(dequeue *p);  int empty(dequeue *p);  int full(dequeue *p);  void enqueueR(dequeue *p,int x);  void enqueueF(dequeue *p,int x);  int dequeueF(dequeue *p);  int dequeueR(dequeue *p);  void print(dequeue *p);
  • 7. DEQUE int empty(dequeue *P) { if(P->rear==-1) return(1); return(0); } int full(dequeue *P) { if((P->rear+1)%MAX==P->front) return(1); return(0); }
  • 8. DEQUE  void initialize(dequeue *p);  int empty(dequeue *p);  int full(dequeue *p);  void enqueueR(dequeue *p,int x);  void enqueueF(dequeue *p,int x);  int dequeueF(dequeue *p);  int dequeueR(dequeue *p);  void print(dequeue *p);
  • 9. DEQUE void enqueueR(dequeue *P, int x) { if(empty(P)) { P->rear=0; P->front=0; P->data[0]=x; } else { P->rear=(P->rear+1)%MAX; P->data[P->rear]=x; } }
  • 10. DEQUE  void initialize(dequeue *p);  int empty(dequeue *p);  int full(dequeue *p);  void enqueueR(dequeue *p,int x);  void enqueueF(dequeue *p,int x);  int dequeueF(dequeue *p);  int dequeueR(dequeue *p);  void print(dequeue *p);
  • 11. DEQUE void enqueueF(dequeue *P, int x) { if(empty(P)) { P->rear=0; P->front=0; P->data[0]=x; } else { P->front=(P->front-1+MAX)%MAX; P->data[P->front]=x; } }
  • 12. DEQUE  void initialize(dequeue *p);  int empty(dequeue *p);  int full(dequeue *p);  void enqueueR(dequeue *p,int x);  void enqueueF(dequeue *p,int x);  int dequeueF(dequeue *p);  int dequeueR(dequeue *p);  void print(dequeue *p);
  • 13. DEQUE int dequeueF(dequeue *P) { int x; x=P->data[P->front]; if(P->rear==P->front) /*delete the last element */ initialize(P); else P->front=(P->front+1)%MAX; return(x); }
  • 14. DEQUE  void initialize(dequeue *p);  int empty(dequeue *p);  int full(dequeue *p);  void enqueueR(dequeue *p,int x);  void enqueueF(dequeue *p,int x);  int dequeueF(dequeue *p);  int dequeueR(dequeue *p);  void print(dequeue *p);
  • 15. DEQUE int dequeueR(dequeue *P) { int x; x=P->data[P->rear]; if(P->rear==P->front) initialize(P); else P->rear=(P->rear-1+MAX)%MAX; return(x); }
  • 16. DEQUE  void initialize(dequeue *p);  int empty(dequeue *p);  int full(dequeue *p);  void enqueueR(dequeue *p,int x);  void enqueueF(dequeue *p,int x);  int dequeueF(dequeue *p);  int dequeueR(dequeue *p);  void print(dequeue *p);
  • 17. DEQUE void print(dequeue *P) { if(empty(P)) { printf("nQueue is empty!!"); exit(0); } int i ; i=P->front; while(i!=P->rear) { printf("n%d",P->data[i]); i=(i+1)%MAX; } printf("n%dn",P->data[P->rear]); }
  • 18. REFER DS Lab Manual for complete program
  • 19. VARIATIONS OF DEQUE  There are two variations of a deque that are as follows: (1)Input restricted deque: It allows insertion of elements at one end only but deletion can be done at both ends. (2)Output restricted deque: It allows deletion of elements at one end only but insertion can be done at both ends.  The implementation of both these queues is similar to the implementation of deque. The only difference is that in input restricted queue, function for insertion in the beginning is not needed whereas in output-restricted queue, function for deletion in the beginning is not needed.