R
roubir
Can some please implement a class called MyList to finish this off?
public class MyList<E extends Comparable<E>> extends List<E> {
}
----------------------------------------------------------------------------------------------------
It must be implemented with this List.java:
public abstract class List<E extends Comparable<E>> {
protected class Node<T extends Comparable<T>> {
protected Node(T data) {
this.data = data;
}
protected T data;
protected Node<T> next;
}
public abstract void insert(int index, E data) throws ListException;
public boolean isEmpty() { return head == null; }
public abstract E remove(int index) throws ListException;
public void reverse() { head = reverse(head, null); }
protected abstract Node<E> reverse(Node<E> curr, Node<E> prev);
public abstract int search(E data) throws ListException;
public int size() { return size; }
protected Node<E> head;
protected int size;
}
I need help for this assignment ......
Thanks...
public class MyList<E extends Comparable<E>> extends List<E> {
}
----------------------------------------------------------------------------------------------------
It must be implemented with this List.java:
public abstract class List<E extends Comparable<E>> {
protected class Node<T extends Comparable<T>> {
protected Node(T data) {
this.data = data;
}
protected T data;
protected Node<T> next;
}
public abstract void insert(int index, E data) throws ListException;
public boolean isEmpty() { return head == null; }
public abstract E remove(int index) throws ListException;
public void reverse() { head = reverse(head, null); }
protected abstract Node<E> reverse(Node<E> curr, Node<E> prev);
public abstract int search(E data) throws ListException;
public int size() { return size; }
protected Node<E> head;
protected int size;
}
I need help for this assignment ......
Thanks...