Question: Implement the Deque interface given below using java,util.ArrayList as an adaptee. Implement as a class adapter. Your class must not have any unnecessary methods. import
Implement the Deque interface given below using java,util.ArrayList as an adaptee. Implement as a class adapter. Your class must not have any unnecessary methods. import java.util.*; public interface Deque { public boolean addAtTail(Object value); public Object removeElementAtTail(); public Object getElementAtTail(); public boolean addAtHead(Object value); public Object removeElementAtHead(); public Object getElementAtHead(); public int size(); public void clear(); public Iterator iterator(); }
Question2
Implement the Deque interface given below. Use java,util.ArrayList as an adaptee. Implement as an object adapter.
import java.util.*;
public interface Deque {
public boolean addAtTail(Object value);
public Object removeElementAtTail();
public Object getElementAtTail();
public boolean addAtHead(Object value);
public Object removeElementAtHead();
public Object getElementAtHead();
public int size();
public void clear();
public Iterator iterator();
}
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
