Back
Deque Visualizer
Double-ended Queue - Operations allowed at both ends
3
Size
20
Front
40
Rear
8
Max Size
Ready for deque operations
Value:
Speed:
Slow
Medium
Fast
Max Size:
6
8
10
Deque Structure (Front ↔ Rear)
FRONT (Add/Remove)
REAR (Add/Remove)
20
Index 0
Front
↔
30
Index 1
↔
40
Index 2
Rear
Capacity: 3/8
Deque Operations Flow
ADD FRONT
addFront()
↓
REMOVE FRONT
removeFront()
←
DEQUE
Double-ended
→
ADD REAR
addRear()
↓
REMOVE REAR
removeRear()
Add Front
Add Rear
Remove Front
Remove Rear
Peek Front
Peek Rear
Clear All
Deque Operations:
Front Operations:
addFront:
Insert element at front
removeFront:
Remove element from front
peekFront:
View front element
Rear Operations:
addRear:
Insert element at rear
removeRear:
Remove element from rear
peekRear:
View rear element
Characteristics:
Double-ended:
Operations at both ends
Time Complexity:
O(1) for all operations
Space Complexity:
O(n) where n is number of elements
Use Cases:
Palindrome checking, sliding window problems, A* algorithm
Advantage:
Combines stack and queue functionality