class AbsSetU extends AbsSet{

/* IMPLEMENTS
  public int findElement(SetElement  element)
  public void insert(SetElement  element)
  public void deleteAtIndex(int index)
******/

  public AbsSetU(int capacity) { super(capacity);}

  public  int findElement(SetElement  element){
    // returns the index of the element in the array
    // or NOT_FOUND  if its not there.

   for (int i=0; i < getsize(); i=i+1)
      if (element.equals(getElement(i)) ) return i;
   return NOT_FOUND ;
  }        

  public void insert(SetElement  element){
    // the set is not at full capacity and 
    // the element is not already there
    setElement(getsize(), element);
    setsize(getsize()+1);
  }


  public void deleteAtIndex(int index){
    // deletes the item at the given index in the array
   setElement(index, getElement(getsize()-1) );
   setsize(getsize()-1);
  }

}

