Question: Implement these interfaces using Doubly Linked List in java. public interface List { /** * Add item at the end * * @param e */
Implement these interfaces using Doubly Linked List in java.
public interface List{ /** * Add item at the end * * @param e */ void add(T e); /** * add item at index specified * * @param index * @param e */ void add(int index, T e); /** * This method adds an element to the list in the position , after to the * first occurrence of the the target element * * */ void addAfter(T target, T elem); /** * This method adds an element to the list in the position , previous to * the first occurrence of the the target , element * * */ void addBefore(T target, T elem); /** * Retreive element at index * * @param index * @return */ T get(int index); /** * return true if it is empty * * @return */ boolean isEmpty(); /** * add at the start * * @param e */ void prepend(T e); /** * This method removes the first occurance of the target from the list * * */ T remove(T target); /** * return current size of list * * @return */ int size(); }
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
