Delete README.md

package set;
import java.util.ArrayList;
import java.util.Iterator;


public class ArraySet<E> implements SimpleSet<E> {
	private ArrayList<E> set;

	/**
	 * Constructs a new empty set.
	 */
	public ArraySet() {
		set = new ArrayList<E>();
	}

	/** 
	 * Adds the specified element to this set, if it is not already present.
	 * post: x is added to the set if it is not already present
	 * @param  x the element to be added
	 * @return true if the specified element was added
	 */
	public boolean add(E x) {
		for(int i =0; i<set.size(); i++){
			if(set.get(i).equals(x)){
				return false;	
			}
		}
		set.add(x);
		return true;
	}

	/** 
	 * Removes the specified element from this set if it is present. 
	 * post: 	x is removed if it was present
	 * @param 	x the element to remove - if present
	 * @return true if the set contained the specified element
	 */
	public boolean remove(Object x) {
		for(int i =0; i<set.size(); i++){
			if(set.get(i).equals(x)){
				set.remove(i);
				return true;
			}
		}
		return false;
	}

	/** 
	 * Returns true if this set contains the specified element.
	 * @param 	x the element whose presence is to be tested
	 * @return	true if this set contains the specified element
	 */
	public boolean contains(Object x) {	
		for(int i =0; i<set.size(); i++){
			if(set.get(i).equals(x)){
				return true;
			}
		}
		return false;
	}


	/** 
	 * Returns true if this set contains no elements.
	 * @return true if this set contains no elements
	 */
	public boolean isEmpty() {
		if(set.size()<=0){
			return true;
		}
		return false;
	}

	/** 
	 * Returns the number of elements in this set.
	 * @return the number of elements in this set
	 */
	public int size() {
		return set.size();
	}

	/** 
	 * Returns an iterator over the elements in this set.
	 * @return an iterator over the elements in this set
	 */
	public Iterator<E> iterator() {
		Iterator<E> itr =set.iterator();
		return itr;
	}
	
	public boolean addAll(SimpleSet<? extends E> s){
		Iterator<? extends E> itr = s.iterator();
		while(itr.hasNext()){
			set.add(itr.next());
		}
		return true;
	}
	
	

}
package set;

import java.util.NoSuchElementException;
import java.util.Iterator;


public class MaxSet<E extends Comparable<E>> extends ArraySet<E> {
	private E maxElement;
	
	/**
	 * Constructs a new empty set.
	 */
	public MaxSet() {
		super();
	}
	
	/** Returns the currently largest element in this set. 
	pre: the set is not empty 
	post: the set is unchanged 
	@return the currently largest element in this set 
	@throws NoSuchElementException if this set is empty 
	*/ 
	public E getMax() {
		if(isEmpty()){
			throw new NoSuchElementException();
		}else{
		return maxElement;
		}
	}
	
	/** 
	 * Adds the specified element to this set, if it is not already present.
	 * post: x is added to the set if it is not already present
	 * @param  x the element to be added
	 * @return true if the specified element was added
	 */
	public boolean add(E x) {
		if(maxElement.comparedTo(x)> 0){
			maxElement = x;
		}
		
		return super.add(x);
	}
	
	/** 
	 * Removes the specified element from this set if it is present. 
	 * post: 	x is removed if it was present
	 * @param 	x the element to remove - if present
	 * @return true if the set contained the specified element
	 */
	public boolean remove(Object x) {
		if(maxElement.comparedTo(x) <= 0){
			Iterator<E> itr = super.iterator();
			E max = itr.next();
			if(max.equals(x)){
			max= itr.next();	
			}
			while(itr.hasNext());{
			E obj = itr.next();
				if(!obj.equals(x)){
					if(max.comparedTo(obj)>0){
						max = obj;
					}
				}
			}
			maxElement = max;
			
		}
		return super.remove(x);
	}
	
	/** Adds all of the elements in the specified set, for which it is 
	possible, to this set. 
	post: all elements, for which it is possible, in the 
	specified set are added to this set. 
	@return true if this set changed as a result of the call 
	*/
	public boolean addAll(SimpleSet<? extends E> c) {
		Iterator<? extends E> itr = c.iterator();
		while(itr.hasNext()){
			E obj =itr.next();
			if(maxElement.comparedTo(obj)> 0){
				maxElement = obj;
			}
		}
		return super.addAll(c);
	}
	
}