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 Deque;

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

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!