Question: The Sorted List ADT Implement the SortedList class. The SortedList class extends the List class. Both can be seen here (Links to an external site.).
The Sorted List ADT
Implement the SortedList class. The SortedList class extends the List class. Both can be seen here (Links to an external site.). Your assignment is to implement (recursively) all of the abstract methods of the List class. They are:
insert (recursive)
iterator
remove (recursive)
retrieve (recursive)
search (recursive)
You must also implement an Iterator inner class for the SortedList class. You must submit a modified SortedList.java file with your source code. Do not submit and do not modify the List.java file or the Main.java file.
/* * * List.java * */ public abstract class Listimplements Iterable { protected class Node { protected Node(T data) { this.data = data; } protected T data; protected Node next; } public abstract void insert(E data); public abstract void remove(E data); public abstract E retrieve(int index); public abstract boolean search(E data); protected Node head; } /* * * SortedList.java * */ public class SortedList > extends List { }
Having trouble understanding this question in java please add comments
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
