//  Data Structures with Java by John R. Hubbard
//  Copyright McGraw-Hill, 2001
//  Problem 5.8 on page 107

  public boolean remove(Object object)
  { // removes one of the given object from this bag;
    // returns true iff this bag was modified;
    for (int i=0; i<size; i++)
      if (object.equals(objects[i]))
      { objects[i] = objects[--size];
        return true;
      }
    return false;
  }
