Question: public interface DequeInterface { /** * Adds a new entry to the front/back of this dequeue. * * @param newEntry An object to be added.

public interface DequeInterface {

/**

* Adds a new entry to the front/back of this dequeue.

*

* @param newEntry An object to be added.

*/

public void addToFront(T newEntry);

public void addToBack(T newEntry);

/**

* Removes and returns the front/back entry of this dequeue.

*

* @return The object at the front/back of the dequeue.

* @throws EmptyQueueException if the dequeue is empty before the operation.

*/

public T removeFront();

public T removeBack();

/**

* Retrieves the front/back entry of this dequeue.

*

* @return The object at the front/back of the dequeue.

* @throws EmptyQueueException if the dequeue is empty before the operation.

*/

public T getFront();

public T getBack();

/*

* Detects whether this dequeue is empty.

*

* @return True if the queue is empty, or false otherwise.

*/

public boolean isEmpty();

/* Removes all entries from this dequeue. */

public void clear();

public int size();

} // end DequeInterface

In this project you will create a deque that does not allow duplicates. The function of the deques operations addToBack and addToFront leave the deque unchanged if the the objects are already in the deque, Add two operations, moveToBack and moveToFront. These operations will move an existing object the back (or front) of the deque, if the object is present in the deque. If the object is not already in the deque, it will add the object to the back (or front) of the deque. Create an interface NoDuplicatesDequeInterface that extends DequeInterface. Then write class - named CSE274Deque - that is a doubly linked implementation of NoDuplicatesDequeInterface. Finally, write a program that adequately demonstrates your new class. You may use the authors LinkedDeque code as the basis of your code.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!