Question: package list; /** * * * @param * Any Comparable type * * A linked list whose elements are kept in sorted order. */ public
package list;
/**
*
*
* @param
* Any Comparable type
*
* A linked list whose elements are kept in sorted order.
*/
public class SortedLinkedList
DoublyLinkedList
/**
* Create an empty list
*
*/
public SortedLinkedList() {
super();
}
/**
* Creates a sorted list containing the same elements as the parameter
*
* @param list
* the input list
*/
public SortedLinkedList(DoublyLinkedList
super();
// TODO: finish implementing this constructor
}
/**
* Adds the given element to the list, keeping it sorted.
*/
@Override
public void add(T element) {
// TODO: implement this method
}
@Override
public void addFirst(T element) throws UnsupportedOperationException {
// TODO: throw UnsupportedOperationException exception
throw new UnsupportedOperationException();
}
@Override
public void addLast(T element) throws UnsupportedOperationException {
throw new UnsupportedOperationException();
}
}
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
