The world’s Largest Sharp Brain Virtual Experts Marketplace Just a click Away
Levels Tought:
Elementary,Middle School,High School,College,University,PHD
| Teaching Since: | May 2017 |
| Last Sign in: | 398 Weeks Ago, 4 Days Ago |
| Questions Answered: | 66690 |
| Tutorials Posted: | 66688 |
MCS,PHD
Argosy University/ Phoniex University/
Nov-2005 - Oct-2011
Professor
Phoniex University
Oct-2001 - Nov-2016
Provide the specification for the List ADT on the List interface. For this you will have to describe the pre- and pos-conditions for the remaining methods. You may use english in your descriptions, though you may want to consider using Java boolean expressions to make the specifications clearer and unambiguous. Make sure to write the specs as Javadoc comments.
Extend the List interface with the following methods:
Object[] toArray(): returns an array with all the elements in the list.
String toString(): generates a string representation of the list that has the following format: (key,item) -- (key,item) -- (key,item) -- ...
Implement all the methods in every list class.
public interface List,V> {
 Â
  public abstract boolean add(K key,V value);
 Â
  public abstract V remove(K key);
 Â
  public abstract V remove(int n);
 Â
  public abstract V remove();
 Â
  public abstract V lookup(K key);
 Â
  public abstract int size();
 Â
  public abstract V get(int n);
Hel-----------lo -----------Sir-----------/Ma-----------dam-----------Tha-----------nk -----------You----------- fo-----------r u-----------sin-----------g o-----------ur -----------web-----------sit-----------e a-----------nd -----------acq-----------uis-----------iti-----------on -----------of -----------my -----------sol-----------uti-----------on.-----------Ple-----------ase----------- pi-----------ng -----------me -----------on -----------cha-----------t I----------- am----------- on-----------lin-----------e o-----------r i-----------nbo-----------x m-----------e a----------- me-----------ssa-----------ge -----------I w-----------ill----------- be----------- ca-----------tch-----------