SlideShare a Scribd company logo
ALLAH
the most Gracious, the most
merciful
In the name of
Assignment
Submitted by:
 Toseef Hassan (BSF1600847)
 Muhammad Ishfaq (BSF1604280)
 Muhammad Shahzad (BSF1600951)
 Muhammad Umar (BSF1600824)
Class: BS Information Technology (Eve)-A
Semester: IV Semester
Submitted to:
 Mr. Khalid Mehmood
(Head Of Department)
Information Technology
Division of Science & Technology
QUEUES
Overview:
 Simple Queue
 Circular Queue
 Priority Queue
 Deques
• Input restricted deque
• Output restricted deque
What is a Queue?
 A queue is a linear list which obeys FIFO (First In First
Out) principle to insert & delete values.
 An ordered collection of homogeneous elements.
It’s a non-primitive linear data structure.
Simple Queue
45 20 67 7Q
RearFront
Serving Agent
The Queue Operations:
Insertion or Enqueue:
Placing an item in a queue is called “insertion or
enqueue”, which is done at the end of the queue called
“rear” or “tail”.
Deletion or Dequeue:
Removing an item from a queue is called “deletion or
dequeue”, which is done at the other end of the queue
called “front” or “head”.
Insertion or Enqueue:
Algorithm:
If (rear = N-1 )
print (“*Queue is Full*”);
Else
rear = rear + 1; //rear=0
Q[rear] = item
The Queue Operations:
45Q
Rear
0 1 2 3
Where N is the length of array (4 in this
case)
Rear= -1 (First time only)
Front= -1
Item 45
Insertion or Enqueue:
Algorithm:
If (rear = N-1 ) // rear=0
print (“*Queue is Full*”);
Else
rear = rear + 1; //rear=1
Q[rear] = item
The Queue Operations:
45 32Q
Rear
0 1 2 3
N= 4
Front= -1
Item 32
Insertion or Enqueue:
Algorithm:
If (rear = N-1 ) // rear=1
print (“*Queue is Full*”);
Else
rear = rear + 1; //rear=2
Q[rear] = item
The Queue Operations:
45 32 23Q
Rear
0 1 2 3
N= 4
Front= -1
Item 23
Insertion or Enqueue:
Algorithm:
If (rear = N-1 ) // rear=2
print (“*Queue is Full*”);
Else
rear = rear + 1; //rear=3
Q[rear] = item
The Queue Operations:
45 32 23 07Q
Rear
0 1 2 3
N= 4
Front= -1
Item 07
NOW
If we again call the insert() function, insertion
is unsuccessful because queue is full.
Insertion or Enqueue:
Algorithm:
If (rear = N-1 ) // rear=3
print (“*Queue is Full*”);
Else
rear = rear + 1;
Q[rear] = item
The Queue Operations:
45 32 23 07Q
Rear
0 1 2 3
N= 4
Front= -1
Item 10
*Insertion Unsuccessful*
Deletion or Dequeue:
Algorithm:
If (front =rear) // -1 = 3
print (“Queue is empty”);
Else
Front = front + 1;
item = Q [front];
Return item;
The Queue Operations:
45 32 23 07Q
Rear
0 1 2 3
N= 4
Front= -1
Front
Deletion or Dequeue:
Algorithm:
If (front =rear) // 0 = 3
print (“Queue is empty”);
Else
Front = front + 1;
item = Q [front];
Return item;
The Queue Operations:
32 23 07Q
Rear
0 1 2 3
N= 4
Front= 0
Front
Deletion or Dequeue:
Algorithm:
If (front =rear) // 1 = 3
print (“Queue is empty”);
Else
Front = front + 1;
item = Q [front];
Return item;
The Queue Operations:
23 07Q
Rear
0 1 2 3
N= 4
Front= 1
Front
Deletion or Dequeue:
Algorithm:
If (front =rear) // 2 = 3
print (“Queue is empty”);
Else
Front = front + 1;
item = Q [front];
Return item;
The Queue Operations:
07Q
Rear
0 1 2 3
N= 4
Front= 2
Front
Deletion or Dequeue:
Algorithm:
If (front =rear) // 3 = 3
print (“Queue is empty”);
Else
Front = front + 1;
item = Q [front];
Return item;
The Queue Operations:
Q
Rear
0 1 2 3
N= 4
Front= 3
Front
We have seen that all the values of queue are deleted
one by one, hence it can accommodate four more
values being empty.
But still, we can’t insert new values because;
Rear=3 and “Queue is full” condition invokes.
This is the major fault of simple queue that we can
only insert values once in a queue because there is no
mechanism to bring “rear” back to beginning (0).
Disadvantages of Simple Queue:
Circular Queue:
Circular queues were introduced to overcome the
limitations of simple queue.
As the name indicates a circular queue is not linear in
structure but instead it is circular.
Front and Rear variables display a circular movement
(clock wise) over the queue data structure.
As the Rear or Front variable reaches the end of the
queue, it is send back to beginning of the queue
using the mod function.
A B DCCirc_Q
Front Rear
(a) Initial circular queue
DCCirc_Q
Front Rear
(b) Circular queue after two
deletions
E DCCirc_Q
FrontRear
(c) Circ_Q after insertion of e
E F DCCirc_Q
FrontRear
(d) Circ_Q after insertion of
f
Workingofacircularqueue
Insertion:
 Algorithm:
Insert (front, rear, n, item)
{ int p=rear;
rear= (rear+1)%n; // rear=1
If (front==rear)
{ Print “*Queue is full*”
rear=p;}
Q [rear] = item;
}
45Q
Rear
0 1 2 3
Where N is the length of array (4
in this case)
Rear= 0 (First time only)
Front= 0
Item 45
Front
Insertion:
 Algorithm:
Insert (front, rear, n, item)
{ int p=rear;
rear= (rear+1)%n; // rear=2
If (front==rear)
{ Print “*Queue is full*”
rear=p;}
Q [rear] = item;
}
45 32Q
Rear
0 1 2 3
Item 32
Front
Insertion:
 Algorithm:
Insert (front, rear, n, item)
{ int p=rear;
rear= (rear+1)%n; // rear=3
If (front==rear)
{ Print “*Queue is full*”
rear=p;}
Q [rear] = item;
}
45 32 23Q
Rear
0 1 2 3
Item 23
Front
Insertion:
 Algorithm:
Insert (front, rear, n, item)
{ int p=rear; // p=3
rear= (rear+1)%n; // rear=0
If (front==rear)
{ Print “*Queue is full*”
rear=p;}
Q [rear] = item;
}
45 32 23Q
Rear
0 1 2 3
Item 23
Front
Deletion:
 Algorithm:
Delete (front, rear, n, item)
{ If (front==rear)
Print “*Queue is empty*”;
front = (front+1) % n; // front=1
Item = Q [front];
}
45 32 23Q
Rear
0 1 2 3
Front
Deletion:
 Algorithm:
Delete (front, rear, n, item)
{ If (front==rear)
Print “*Queue is empty*”;
front = (front+1) % n; // front=2
Item = Q [front];
}
32 23Q
Rear
0 1 2 3
Front
Deletion:
 Algorithm:
Delete (front, rear, n, item)
{ If (front==rear)
Print “*Queue is empty*”;
front = (front+1) % n; // front=3
Item = Q [front];
}
23Q
Rear
0 1 2 3
Front
Deletion:
 Algorithm:
Delete (front, rear, n, item)
{ If (front==rear)
Print “*Queue is empty*”;
front = (front+1) % n; // front=3
Item = Q [front];
}
Q
Rear
0 1 2 3
Front
Let’s try Insertion again
Insert (front, rear, n, item)
{ int p=rear;
rear= (rear+1)%n; // rear=0
If (front==rear)
{ Print “*Queue is full*”
rear=p;}
Q [rear] = item;
}
70Q
Rear Front
Item 70
0 1 2 3
Rear= 3
Front= 3
Let’s try Insertion again
Insert (front, rear, n, item)
{ int p=rear;
rear= (rear+1)%n; // rear=1
If (front==rear)
{ Print “*Queue is full*”
rear=p;}
Q [rear] = item;
}
70 89Q
Rear Front
Item 89
0 1 2 3
Rear= 0
Front= 3
Let’s try Insertion again
Insert (front, rear, n, item)
{ int p=rear;
rear= (rear+1)%n; // rear=2
If (front==rear)
{ Print “*Queue is full*”
rear=p;}
Q [rear] = item;
}
70 89 27Q
Rear Front
Item 27
0 1 2 3
Rear= 1
Front= 3
Let’s try Insertion again
Insert (front, rear, n, item)
{ int p=rear;
rear= (rear+1)%n; // rear=3
If (front==rear)
{ Print “*Queue is full*”
rear=p;}
Q [rear] = item;
}
70 89 27Q
Rear Front
0 1 2 3
Rear= 2
Front= 3
Priority Queue:
 A priority queue is a queue in which insertion or deletion of
items from any position in the queue are done based on some
property (such as priority of task).
Doctor Example:
Normal Patients Queue
Emergency Patients Queue
1 2 3 4 5
Doctor
SUSPENDED
Deques:
 A deque (double ended queue) is a linear list in which all insertions and
deletions are made at the end of the list. A dequeue is pronounced as
‘deck’ or ‘de queue.’
 A deque is more general than a stack or queue and is a sort of FLIDLO
(First In Last In First Out Last Out).
 A deque has two variants; input restricted queue and output restricted
queue.
 An input restricted dequeue is one where insertions are allowed at one
end only while deletions are allowed at both ends.
 An output restricted dequeue allows insertions at both ends of the queue
but permits deletions only at one end.
Bottom Top
Push
Pop
Stack
Front Rear
Insert
Delete
Queue
Front Rear
Insert
Delete
Dequeue
Delete
Insert
Front Rear
Insert
Delete
Input restricted Dequeue
Delete
Front Rear
Insert
Output restricted Dequeue
Delete
Insert
THANK YOU!

More Related Content

PPTX
Queues in C++
PPT
QUEUE IN DATA STRUCTURE USING C
PPTX
Unit 4 queue
PPT
PPTX
Detalied information of queue
PPTX
Queue in Data Structure
PPTX
My lectures circular queue
PDF
Dsa circular queue
Queues in C++
QUEUE IN DATA STRUCTURE USING C
Unit 4 queue
Detalied information of queue
Queue in Data Structure
My lectures circular queue
Dsa circular queue

What's hot (20)

PPTX
Queue
PDF
What is Stack, Its Operations, Queue, Circular Queue, Priority Queue
PPTX
Queue Data Structure (w/ php egs)
PDF
Queue as data_structure
PPTX
Deque and its applications
PPTX
PPTX
PPSX
Data Structure (Queue)
PPTX
stacks and queues
PDF
05 queues
PDF
Queues-handouts
PPTX
Queue-Data Structure
PPTX
queue & its applications
PPT
Queue AS an ADT (Abstract Data Type)
PPT
Notes DATA STRUCTURE - queue
PPT
Queue data structure
PPSX
Queue by rajanikanth
Queue
What is Stack, Its Operations, Queue, Circular Queue, Priority Queue
Queue Data Structure (w/ php egs)
Queue as data_structure
Deque and its applications
Data Structure (Queue)
stacks and queues
05 queues
Queues-handouts
Queue-Data Structure
queue & its applications
Queue AS an ADT (Abstract Data Type)
Notes DATA STRUCTURE - queue
Queue data structure
Queue by rajanikanth
Ad

Similar to Queues presentation (20)

PDF
Polynomialmotilalanehrunationalinstitute.pdf
PPTX
Queue - Data Structure - Notes
PPTX
@Chapter 4 DSA Part II.pptx
PPT
queue (1).ppt queue notes and ppt in Data Structures
PPTX
4. Queues in Data Structure
PPT
Lec-07 Queues.ppt queues introduction to queue
PDF
LEC4-DS ALGO.pdf
PPTX
Queue data structures and operation on data structures
PPTX
PPTX
Stack and Queue.pptx university exam preparation
PPT
Lecture three of datat structures ,.The Queue-ds.ppt
PPTX
RPT_02_B_Queue presentation for FE students
PPTX
Stack.pptx
PPT
Queues & ITS TYPES
PPTX
Queue(lecture8).pptx
PPTX
DS ppt1.pptx.c programing. Engineering. Data structure
PPT
Queues.ppt
PPTX
Bsc cs ii dfs u-2 linklist,stack,queue
PPTX
Bca ii dfs u-2 linklist,stack,queue
Polynomialmotilalanehrunationalinstitute.pdf
Queue - Data Structure - Notes
@Chapter 4 DSA Part II.pptx
queue (1).ppt queue notes and ppt in Data Structures
4. Queues in Data Structure
Lec-07 Queues.ppt queues introduction to queue
LEC4-DS ALGO.pdf
Queue data structures and operation on data structures
Stack and Queue.pptx university exam preparation
Lecture three of datat structures ,.The Queue-ds.ppt
RPT_02_B_Queue presentation for FE students
Stack.pptx
Queues & ITS TYPES
Queue(lecture8).pptx
DS ppt1.pptx.c programing. Engineering. Data structure
Queues.ppt
Bsc cs ii dfs u-2 linklist,stack,queue
Bca ii dfs u-2 linklist,stack,queue
Ad

Recently uploaded (20)

PPTX
Final SEM Unit 1 for mit wpu at pune .pptx
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PPTX
The various Industrial Revolutions .pptx
PDF
A novel scalable deep ensemble learning framework for big data classification...
PDF
2021 HotChips TSMC Packaging Technologies for Chiplets and 3D_0819 publish_pu...
PDF
Architecture types and enterprise applications.pdf
PDF
NewMind AI Weekly Chronicles - August'25-Week II
PPTX
Modernising the Digital Integration Hub
PPTX
Programs and apps: productivity, graphics, security and other tools
PDF
1 - Historical Antecedents, Social Consideration.pdf
PPTX
O2C Customer Invoices to Receipt V15A.pptx
PDF
Zenith AI: Advanced Artificial Intelligence
PDF
Transform Your ITIL® 4 & ITSM Strategy with AI in 2025.pdf
PDF
ENT215_Completing-a-large-scale-migration-and-modernization-with-AWS.pdf
PPTX
Chapter 5: Probability Theory and Statistics
PPTX
cloud_computing_Infrastucture_as_cloud_p
PDF
STKI Israel Market Study 2025 version august
PDF
Enhancing emotion recognition model for a student engagement use case through...
PDF
DASA ADMISSION 2024_FirstRound_FirstRank_LastRank.pdf
PDF
Microsoft Solutions Partner Drive Digital Transformation with D365.pdf
Final SEM Unit 1 for mit wpu at pune .pptx
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
The various Industrial Revolutions .pptx
A novel scalable deep ensemble learning framework for big data classification...
2021 HotChips TSMC Packaging Technologies for Chiplets and 3D_0819 publish_pu...
Architecture types and enterprise applications.pdf
NewMind AI Weekly Chronicles - August'25-Week II
Modernising the Digital Integration Hub
Programs and apps: productivity, graphics, security and other tools
1 - Historical Antecedents, Social Consideration.pdf
O2C Customer Invoices to Receipt V15A.pptx
Zenith AI: Advanced Artificial Intelligence
Transform Your ITIL® 4 & ITSM Strategy with AI in 2025.pdf
ENT215_Completing-a-large-scale-migration-and-modernization-with-AWS.pdf
Chapter 5: Probability Theory and Statistics
cloud_computing_Infrastucture_as_cloud_p
STKI Israel Market Study 2025 version august
Enhancing emotion recognition model for a student engagement use case through...
DASA ADMISSION 2024_FirstRound_FirstRank_LastRank.pdf
Microsoft Solutions Partner Drive Digital Transformation with D365.pdf

Queues presentation

  • 1. ALLAH the most Gracious, the most merciful In the name of
  • 2. Assignment Submitted by:  Toseef Hassan (BSF1600847)  Muhammad Ishfaq (BSF1604280)  Muhammad Shahzad (BSF1600951)  Muhammad Umar (BSF1600824) Class: BS Information Technology (Eve)-A Semester: IV Semester Submitted to:  Mr. Khalid Mehmood (Head Of Department) Information Technology Division of Science & Technology
  • 4. Overview:  Simple Queue  Circular Queue  Priority Queue  Deques • Input restricted deque • Output restricted deque
  • 5. What is a Queue?  A queue is a linear list which obeys FIFO (First In First Out) principle to insert & delete values.  An ordered collection of homogeneous elements. It’s a non-primitive linear data structure.
  • 6. Simple Queue 45 20 67 7Q RearFront
  • 8. The Queue Operations: Insertion or Enqueue: Placing an item in a queue is called “insertion or enqueue”, which is done at the end of the queue called “rear” or “tail”. Deletion or Dequeue: Removing an item from a queue is called “deletion or dequeue”, which is done at the other end of the queue called “front” or “head”.
  • 9. Insertion or Enqueue: Algorithm: If (rear = N-1 ) print (“*Queue is Full*”); Else rear = rear + 1; //rear=0 Q[rear] = item The Queue Operations: 45Q Rear 0 1 2 3 Where N is the length of array (4 in this case) Rear= -1 (First time only) Front= -1 Item 45
  • 10. Insertion or Enqueue: Algorithm: If (rear = N-1 ) // rear=0 print (“*Queue is Full*”); Else rear = rear + 1; //rear=1 Q[rear] = item The Queue Operations: 45 32Q Rear 0 1 2 3 N= 4 Front= -1 Item 32
  • 11. Insertion or Enqueue: Algorithm: If (rear = N-1 ) // rear=1 print (“*Queue is Full*”); Else rear = rear + 1; //rear=2 Q[rear] = item The Queue Operations: 45 32 23Q Rear 0 1 2 3 N= 4 Front= -1 Item 23
  • 12. Insertion or Enqueue: Algorithm: If (rear = N-1 ) // rear=2 print (“*Queue is Full*”); Else rear = rear + 1; //rear=3 Q[rear] = item The Queue Operations: 45 32 23 07Q Rear 0 1 2 3 N= 4 Front= -1 Item 07
  • 13. NOW If we again call the insert() function, insertion is unsuccessful because queue is full.
  • 14. Insertion or Enqueue: Algorithm: If (rear = N-1 ) // rear=3 print (“*Queue is Full*”); Else rear = rear + 1; Q[rear] = item The Queue Operations: 45 32 23 07Q Rear 0 1 2 3 N= 4 Front= -1 Item 10 *Insertion Unsuccessful*
  • 15. Deletion or Dequeue: Algorithm: If (front =rear) // -1 = 3 print (“Queue is empty”); Else Front = front + 1; item = Q [front]; Return item; The Queue Operations: 45 32 23 07Q Rear 0 1 2 3 N= 4 Front= -1 Front
  • 16. Deletion or Dequeue: Algorithm: If (front =rear) // 0 = 3 print (“Queue is empty”); Else Front = front + 1; item = Q [front]; Return item; The Queue Operations: 32 23 07Q Rear 0 1 2 3 N= 4 Front= 0 Front
  • 17. Deletion or Dequeue: Algorithm: If (front =rear) // 1 = 3 print (“Queue is empty”); Else Front = front + 1; item = Q [front]; Return item; The Queue Operations: 23 07Q Rear 0 1 2 3 N= 4 Front= 1 Front
  • 18. Deletion or Dequeue: Algorithm: If (front =rear) // 2 = 3 print (“Queue is empty”); Else Front = front + 1; item = Q [front]; Return item; The Queue Operations: 07Q Rear 0 1 2 3 N= 4 Front= 2 Front
  • 19. Deletion or Dequeue: Algorithm: If (front =rear) // 3 = 3 print (“Queue is empty”); Else Front = front + 1; item = Q [front]; Return item; The Queue Operations: Q Rear 0 1 2 3 N= 4 Front= 3 Front
  • 20. We have seen that all the values of queue are deleted one by one, hence it can accommodate four more values being empty. But still, we can’t insert new values because; Rear=3 and “Queue is full” condition invokes. This is the major fault of simple queue that we can only insert values once in a queue because there is no mechanism to bring “rear” back to beginning (0). Disadvantages of Simple Queue:
  • 21. Circular Queue: Circular queues were introduced to overcome the limitations of simple queue. As the name indicates a circular queue is not linear in structure but instead it is circular. Front and Rear variables display a circular movement (clock wise) over the queue data structure. As the Rear or Front variable reaches the end of the queue, it is send back to beginning of the queue using the mod function.
  • 22. A B DCCirc_Q Front Rear (a) Initial circular queue DCCirc_Q Front Rear (b) Circular queue after two deletions E DCCirc_Q FrontRear (c) Circ_Q after insertion of e E F DCCirc_Q FrontRear (d) Circ_Q after insertion of f Workingofacircularqueue
  • 23. Insertion:  Algorithm: Insert (front, rear, n, item) { int p=rear; rear= (rear+1)%n; // rear=1 If (front==rear) { Print “*Queue is full*” rear=p;} Q [rear] = item; } 45Q Rear 0 1 2 3 Where N is the length of array (4 in this case) Rear= 0 (First time only) Front= 0 Item 45 Front
  • 24. Insertion:  Algorithm: Insert (front, rear, n, item) { int p=rear; rear= (rear+1)%n; // rear=2 If (front==rear) { Print “*Queue is full*” rear=p;} Q [rear] = item; } 45 32Q Rear 0 1 2 3 Item 32 Front
  • 25. Insertion:  Algorithm: Insert (front, rear, n, item) { int p=rear; rear= (rear+1)%n; // rear=3 If (front==rear) { Print “*Queue is full*” rear=p;} Q [rear] = item; } 45 32 23Q Rear 0 1 2 3 Item 23 Front
  • 26. Insertion:  Algorithm: Insert (front, rear, n, item) { int p=rear; // p=3 rear= (rear+1)%n; // rear=0 If (front==rear) { Print “*Queue is full*” rear=p;} Q [rear] = item; } 45 32 23Q Rear 0 1 2 3 Item 23 Front
  • 27. Deletion:  Algorithm: Delete (front, rear, n, item) { If (front==rear) Print “*Queue is empty*”; front = (front+1) % n; // front=1 Item = Q [front]; } 45 32 23Q Rear 0 1 2 3 Front
  • 28. Deletion:  Algorithm: Delete (front, rear, n, item) { If (front==rear) Print “*Queue is empty*”; front = (front+1) % n; // front=2 Item = Q [front]; } 32 23Q Rear 0 1 2 3 Front
  • 29. Deletion:  Algorithm: Delete (front, rear, n, item) { If (front==rear) Print “*Queue is empty*”; front = (front+1) % n; // front=3 Item = Q [front]; } 23Q Rear 0 1 2 3 Front
  • 30. Deletion:  Algorithm: Delete (front, rear, n, item) { If (front==rear) Print “*Queue is empty*”; front = (front+1) % n; // front=3 Item = Q [front]; } Q Rear 0 1 2 3 Front
  • 31. Let’s try Insertion again Insert (front, rear, n, item) { int p=rear; rear= (rear+1)%n; // rear=0 If (front==rear) { Print “*Queue is full*” rear=p;} Q [rear] = item; } 70Q Rear Front Item 70 0 1 2 3 Rear= 3 Front= 3
  • 32. Let’s try Insertion again Insert (front, rear, n, item) { int p=rear; rear= (rear+1)%n; // rear=1 If (front==rear) { Print “*Queue is full*” rear=p;} Q [rear] = item; } 70 89Q Rear Front Item 89 0 1 2 3 Rear= 0 Front= 3
  • 33. Let’s try Insertion again Insert (front, rear, n, item) { int p=rear; rear= (rear+1)%n; // rear=2 If (front==rear) { Print “*Queue is full*” rear=p;} Q [rear] = item; } 70 89 27Q Rear Front Item 27 0 1 2 3 Rear= 1 Front= 3
  • 34. Let’s try Insertion again Insert (front, rear, n, item) { int p=rear; rear= (rear+1)%n; // rear=3 If (front==rear) { Print “*Queue is full*” rear=p;} Q [rear] = item; } 70 89 27Q Rear Front 0 1 2 3 Rear= 2 Front= 3
  • 35. Priority Queue:  A priority queue is a queue in which insertion or deletion of items from any position in the queue are done based on some property (such as priority of task).
  • 36. Doctor Example: Normal Patients Queue Emergency Patients Queue 1 2 3 4 5 Doctor SUSPENDED
  • 37. Deques:  A deque (double ended queue) is a linear list in which all insertions and deletions are made at the end of the list. A dequeue is pronounced as ‘deck’ or ‘de queue.’  A deque is more general than a stack or queue and is a sort of FLIDLO (First In Last In First Out Last Out).  A deque has two variants; input restricted queue and output restricted queue.  An input restricted dequeue is one where insertions are allowed at one end only while deletions are allowed at both ends.  An output restricted dequeue allows insertions at both ends of the queue but permits deletions only at one end.
  • 41. Front Rear Insert Output restricted Dequeue Delete Insert