Question: Consider implementing a Deque using a layered implementation on a LinkedList. Consider the spec below for a Deque. A deque is a structure which allows
Consider implementing a Deque using a layered implementation on a LinkedList. Consider the spec below for a Deque. A deque is a structure which allows insertion and deletion from either end. As appropriate the methds in the class should raise the exception EmptyDequeException.
public class Deque
{
private LinkedList
public Deque () {}
public T removeFirst() throws EmptyDequeException {}
public T getFirst() throws EmptyDequeException {}
pulic void addLast() {}
public T removeLast() throws EmptyDequeException {}
public boolean isEmpty ()
public String toString ()
public void clear () {}
public void addFirst (T data) {}
public T getLast() throws EmptyDequeException {}
public int size () {}
}
This needs to be written in java. thank you
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
