Concept Flow - Double Ended Queue Deque
Start
Check Operation Type
Add Front
→Create New Node
New Node.next = head
head.prev = New Node
head = New Node
Done
Add Rear
→Create New Node
tail.next = New Node
New Node.prev = tail
tail = New Node
Done
Remove Front
→Check if empty
head = head.next
head.prev = null
Done
Remove Rear
→Check if empty
tail = tail.prev
tail.next = null
Done
Shows how adding or removing nodes at front or rear updates pointers and the deque ends.
