Write a note on double ended queue

Skip to content. Change Language. Related Articles. Data Structure. Linked List. Binary Tree. Binary Search Tree.

Related Articles

Advanced Data Structure. Table of Contents. Improve Article. Save Article.

write a note on double ended queue

Like Article. Deque or Double Ended Queue is a generalized version of Queue data structure that allows insert and delete at both ends.

Operations on a Deque

Operations on Deque: Mainly the following four basic operations are performed on queue: insertFront : Adds an item at the front of Deque. In addition to above operations, following operations are also supported getFront : Gets the front item from queue. Applications of Deque: Since Deque supports both stack and queue operations, it can be used as both.

write a note on double ended queue

The Deque data structure supports clockwise and anticlockwise rotations in O 1 time which can be useful in certain applications. Also, the problems where elements need to mote removed and or added both ends can be efficiently solved using Deque.

For example see Maximum of all subarrays of size k problem. Previous Applications of Priority Queue. Recommended Articles. Article Contributed By :.

write a note on double ended queue

Easy Normal Medium Hard Expert. Writing code in comment? Please use ide. Load Comments. What's New. Most popular in Queue.

Techopedia Explains Double-Ended Queue (Deque)

More related articles in Queue. We use cookies to ensure you have the best browsing experience on our website. Start Your Coding Journey Now! Login Register.]