Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Using Java. E6.6. A double-ended queue is a special type of queue in which adds

ID: 3606719 • Letter: U

Question

Using Java.

E6.6. A double-ended queue is a special type of queue in which adds and deletes are supported at both ends, meaning that enqueue and dequeue can be done at the front as well as the rear. Thus, it supports four fundamental operations: enqueueFront, enqueue Rear, dequeueFront, and dequeue Rear. Discuss the suitability of each of the following storage implementations for a double-ended queue, arguing as we did in Section 6.. (a) Array list (b) Array (c) Linked List (d) Doubly Linked List

Explanation / Answer

Double ended deque :
Double ended deque is also a queue where it is quite bit different from normal queue and circular queue
in normal queue-insertion is at from ending
removing is from begining i.e it follows first in first out FIFO
but as in DoubleEndedDeque it is one type of Queue where insertion is from both begining and ending and also deletion is from both begining and ending..
for this type of implementation..we cannot implement with given criteria..reasons are explained below..

ArrayList:array list is dynamic list..
which can store duplicate elements in it.
Arraylist can be used for implementing stack and queue but it is not useful for implementing double ended deque
Arrays:
Array implementation of double ended deque is quite very complex and it is not dynamic..because arrays size should be fixed at the time of initialization....arrays cannot be increased its size furthur..this type of datastructre is not posible for implementing double ended queue
LinkedList:
Linked List is dynamic..we can add and remove node in uni directional ..so insertion and deletion is in one directional..LinkedList is also called as Single Linked List..which is dynamic and we can add nodes as many we like..and time complexity is better compare to others
double Linked List:
Double Linked list is where it contains node with
previous link part-data-next link part,so node can be added at front or end anywhere we like..
and it is dynamic and it is the best data structure to implement double ended dequeue..
Double linked list..is improved verson of Single linked linst
single linked list===data->link
double linked list===link->data->link

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote