Question
IN JAVA (NEED ASAP) /** * A simple linked sorted list structure of T objects. Only the * T value contained in the sorted list
IN JAVA (NEED ASAP)
/** * A simple linked sorted list structure of T objects. Only the * T value contained in the sorted list is visible through the * standard sorted list methods. Extends the DoubleLink class, * which already defines the front node, rear node, length, isEmpty, and * iterator. * * @param * this value structure value type. */ public class DoubleSortedList> extends DoubleLink {
/** * Removes duplicates from this List. The list contains one and only one of * each value formerly present in this List. The first occurrence of each * value is preserved. */ public void clean() { // your code here }
/** * Combines contents of two lists into a third. Values are alternated from * the source lists into this List, but the sorted order is preserved. The * source lists are empty when finished. NOTE: value must not be moved, only * nodes. * * @param source1 * The first list to combine with this List. * @param source2 * The second list to combine with this List. */ public void combine(final DoubleSortedList source1, final DoubleSortedList source2) { // your code here }
/** * Determines if this SortedList contains key. * * @param key * The key value to look for. * @return true if key is in this SortedList, false otherwise. */ public boolean contains(final T key) { // your code here }
/** * Finds the number of times key appears in list. * * @param key * The value to look for. * @return The number of times key appears in this SortedList. */ public int count(final T key) { // your code here }
/** * Finds and returns the value in list that matches key. * * @param key * The value to search for. * @return The value that matches key, null otherwise. */ public T find(final T key) { // your code here }
/** * Get the nth item in this SortedList. * * @param n * The index of the item to return. * @return The nth item in this SortedList. * @throws ArrayIndexOutOfBoundsException * if n is not a valid index. */ public T get(final int n) throws ArrayIndexOutOfBoundsException { // your code here }
/** * Finds the location of a value by key in list. * * @param key * The value to search for. * @return The index of key in this SortedList, -1 otherwise. */ public int index(final T key) { // your code here }
/** * Inserts value into this SortedList. Order is preserved. * * @param value * The new value to insert into this SortedList. */ public void insert(final T value) { // your code here }
/** * Creates an intersection of two other Lists into this SortedList. Copies * value to this SortedList. left and right Lists are unchanged. * * @param left * The first List to create an intersection from. * @param right * The second List to create an intersection from. */ public void intersection(final DoubleSortedList left, final DoubleSortedList right) { // your code here }
/** * Determines whether two lists are identical. * * @param that * The list to compare against this SortedList. * @return true if this SortedList contains the same values in the same * order as that, false otherwise. */ public boolean isIdentical(final DoubleSortedList that) { // your code here }
/** * Finds the maximum value in this SortedList. * * @return The maximum value. */ public T max() { // your code here }
/** * Finds the minimum value in this SortedList. * * @return The minimum value. */ public T min() { // your code here }
/** * Finds, removes, and returns the value in this SortedList that matches * key. * * @param key * The value to search for. * @return The value matching key, null otherwise. */ public T remove(final T key) { // your code here }
/** * Removes and returns the value at the front of the list. * * @return the value that has been removed. */ public T removeFront() { // your code here }
/** * Finds and removes all values in this SortedList that match key. * * @param key * The value to search for. */ public void removeMany(final T key) { // your code here }
/** * Removes and returns the value at the rear of the list. * * @return the value that has been removed. */ public T removeRear() { // your code here }
/** * Splits the contents of this List into the target Lists. Moves nodes only * - does not move value or call the high-level methods insert or remove. * this List is empty when done. The first half of this List is moved to * target1, and the last half of this List is moved to target2. If the * resulting lengths are not the same, target1 should have one more element * than target2. * * @param target1 * The first List to move nodes to. * @param target2 * The second List to move nodes to. */ public void split(final DoubleSortedList target1, final DoubleSortedList target2) { // your code here }
/** * Splits the contents of this List into the target Lists. Moves nodes only * - does not move value or call the high-level methods insert or remove. * this List is empty when done. Nodes are moved alternately from this List * to target1 and target2. * * @param target1 * The first List to move nodes to. * @param target2 * The second List to move nodes to. */ public void splitAlternate(final DoubleSortedList target1, final DoubleSortedList target2) { // your code here }
/** * Creates a union of two other Lists into this SortedList. Copies value to * this list. left and right Lists are unchanged. * * @param left * The first List to create a union from. * @param right * The second List to create a union from. */ public void union(final DoubleSortedList left, final DoubleSortedList right) { // your code here } }
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