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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started