Implement the Stack and Queue interfaces with a unique class that is derived from class LinkedDeque (Code

Question:

Implement the Stack and Queue interfaces with a unique class that is derived from class LinkedDeque (Code Fragment 5.21).


Data from in Code Fragment 5.21

The class structure for class LinkedDeque.
We have not bothered to provide an explicit destructor, because the DLinkedList class provides its own destructor, which is automatically invoked when our Linked-Deque structure is destroyed. Most of the member functions for the LinkedDeque class are straightforward generalizations of the corresponding functions of the LinkedQueue class, so we have omitted them. In Code Fragment 5.22, we present the implementations of the member functions for performing insertions and removals of elements from the deque. Observe that, in each case, we simply invoke the appropriate operation from the underlying DLinkedList object.


Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Related Book For  book-img-for-question

Data Structures And Algorithms In C++

ISBN: 9780470383278

2nd Edition

Authors: Michael T. Goodrich, Roberto Tamassia, David M. Mount

Question Posted: