Question: public interface MyList { public int getSize(); // returns the number of items in the list public void insert(E data) throws ListOverflowException; public E getElement(E

public interface MyList {

public int getSize(); // returns the number of items in the list

public void insert(E data) throws ListOverflowException;

public E getElement(E data) throws NoSuchElementException;

public boolean delete(E data); // returns false if the data is not deleted in the list

public int search(E data); // returns index of data, else -1 is return

}

Other than creating the interface shown above, the ListOverflowException class will have to be

created.

NoSuchElementException class is accessed from java.util package.

Create implementation of the above interface in different ways as stipulated below.

Use doubly-linked node to implement the list. Details of the doublylinkednode class are shownbelow.

public interface MyList {public int getSize(); // returns the number of items

DoublyLinkedNode DoublyLinkedNode Illustration - data: T previous data next - next: Node + Node(T data) + getData() : T + setNext (node: Node>) : void + getNext() : Node The doubly linked list illustration: theList nu 71 A B C D null

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 Programming Questions!