Advertisements
Advertisements
Question
How is queue data type different from deque data type?
Solution
In Queue insertion allow in rear end and removal (retrieval) allow from the front end.
Deque, stands for double ended queue, which allows insertion and deletion operation at both ends.
APPEARS IN
RELATED QUESTIONS
An arrangement in which addition and removal of elements can happen from any end is known as ______.
A dequeue is also known as ______.
By adding and deleting the elements in a deque from the same end you can make it work like a ______.
By adding and deleting the elements in a deque from the opposite ends you can make it work like a ______.
Which operation is used to insert an element in the front of the dequeue?
Which operation removes an element from the front of the dequeue?
Which operation removes an element from the rear of the dequeue?
Which operation inserts a new element at the rear of the dequeue?
Deque supports stack but not queue.
Deletion of elements is performed from ______ end of the queue.
______ is a data structure where elements can be added or removed at either end, but not in the middle.
A deque contains ‘z’, ’x’, ’c’, ’v’ and ‘b’. Elements received after deletion are ‘z’, ’b’, ’v’, ’x’ and ‘c’. ______ is the sequence of deletion operation performed on deque.
Write a python program to check whether the given string is palindrome or not, using deque. (Hint : refer to algorithm 4.1)