Learn
Practice
Interview
Resources
Newsletter
F
Toggle theme
0
F
0
Toggle menu
Animations
← Back to All Animations
Design Circular Deque
Bookmark
Circular Array
Doubly Linked List
Input
Mixed Operations
Front Only
Back Only
Edge Cases
Custom
k
=
4
,
operations
=
[insertFront(1), insertLast(2), insertFront(3), insertLast(4), isFull(), deleteFront(), getRear(), insertLast(5), getFront()]
MyCircularDeque
(4)
size
0/4
empty
MyCircularDeque
(4)
size
0/4
empty
insertFront
(1)
size
1/4
null
null
1
head
tail
return true
insertLast
(2)
size
2/4
null
null
next
prev
1
2
head
tail
insertFront
(3)
size
3/4
null
null
next
prev
3
1
2
head
tail
insertLast
(4)
size
4/4
null
null
next
prev
3
1
2
4
head
tail
isFull
()
size
4/4
null
null
next
prev
3
1
2
4
head
tail
return true
deleteFront
()
size
3/4
null
null
next
prev
1
2
4
head
tail
return true
insertLast
(5)
size
3/4
null
null
next
prev
1
2
4
head
tail
insertLast
(5)
size
4/4
null
null
next
prev
1
2
4
5
head
tail
return true
getFront
()
size
4/4
null
null
next
prev
1
2
4
5
head
tail
return 1
algo
master
.
io
Step:
Initialize an empty deque with capacity 4
0 / 24
Input
Mixed Operations
Front Only
Back Only
Edge Cases
Custom
k
=
4
,
operations
=
[insertFront(1), insertLast(2), insertFront(3), insertLast(4), isFull(), deleteFront(), getRear(), insertLast(5), getFront()]
0 / 24
algo
master
.
io
Step:
Initialize an empty deque with capacity 4