Question
Use netbeans IDE program to write LinkedList class that implements ListADT interface. Use the provided SinglyLinkedNode class to store the animals and to create the
Use netbeans IDE program to write LinkedList class that implements ListADT interface. Use the provided SinglyLinkedNode class to store the animals and to create the links.
public interface ListADT
/** * Removes and returns the last element from this list. * * @return the last element from this list */ public T removeLast() throws EmptyCollectionException;
/** * Removes and returns the specified element from this list. * * @param element the element to be removed from the list */ public T remove(T element) throws EmptyCollectionException, ElementNotFoundException;
/** * Returns a reference to the first element in this list. * * @return a reference to the first element in this list */ public T first() throws EmptyCollectionException;
/** * Returns a reference to the last element in this list. * * @return a reference to the last element in this list */ public T last() throws EmptyCollectionException;
/** * Returns true if this list contains the specified target element. * * @param target the target that is being sought in the list * @return true if the list contains this element */ public boolean contains(T target) throws EmptyCollectionException;
/** * Returns true if this list contains no elements. * * @return true if this list contains no elements */ public boolean isEmpty();
/** * Returns the number of elements in this list. * * @return the integer representation of number of elements in this list */ public int size();
/** * Returns an iterator for the elements in this list. * * @return an iterator over the elements in this list */ public Iterator
/** * Returns a string representation of this list. * * @return a string representation of this list */ public String toString(); }
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