Implement the ADT deque in Python, using the Python deque from the COLLECTIONS module. The interface to
Fantastic news! We've Found the answer you've been seeking!
Question:
Implement the ADT deque in Python, using the Python deque from the COLLECTIONS module.
The interface to implement is like the ADT queue plus two methods for inserting and deleting elements at the end. You can call those methods enqueueEnd(item) and dequeueEnd(). You can add a comment in your code for specifying the two methods in your implementation. All the other methods are exactly the ones of the ADT queue interface.
So you have to implement a class, e.g., named MyDeque. Use an object of the class deque from the module collections: from collections import deque. Your class must implement all the required methods.
Related Book For
Data Structures and Algorithms in Java
ISBN: 978-1118771334
6th edition
Authors: Michael T. Goodrich, Roberto Tamassia, Michael H. Goldwasser
Posted Date: