import java.util.*;

public class HW4 {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO Auto-generated method stub

		LinkedList<Integer> l1, l2;
		
		l1 = new LinkedList<Integer>();
		l2 = new LinkedList<Integer>();		
		
		for (int i = 0; i < 100; i = i + 5) {
			l1.add(new Integer(i));
		}
		for (int i = 0; i < 100; i = i + 7) {
			l2.add(new Integer(i));
		}
		
		LinkedList<Integer> l3 = union(l1,l2);
		LinkedList<Integer> l4 = intersection(l1,l2);
		System.out.println(l3);
		System.out.println(l4);
		
		ListIterator<Integer> itr = l2.listIterator(0);
	    addToList(l1, itr);
	    System.out.println(l1);
		
		
	}
	
	public static <X> LinkedList<X> union(LinkedList<X> lst1, LinkedList<X> lst2) {
		/* Should return a linkedlist consisting of all things that are in either lst1 or
		 * lst2. The contains method should be used to determine if a list contains a certain 
		 * object. Assuming lst1 and lst2 have no duplicates, the output should also have no 
		 * duplicates.
		 */
		
		
	}
	
	public static <X> LinkedList<X> intersection(LinkedList<X> lst1, LinkedList<X> lst2) {
		
		/* Should return a linkedlist consisting of all things that are in both lst1 and
		 * lst2. The contains method should be used to determine if a list contains a certain 
		 * object. Assuming lst1 and lst2 have no duplicates, the output should also have no 
		 * duplicates.
		 */
		

	}
	
	public static <X> void addToList(LinkedList<X> lst, ListIterator<X> itr){
		/* itr is an iterator on a certain LinkedList, whereas lst is a possibly different
		 * LinkedList. The method should add all things in the LinkedList corresponding to itr
		 * to the LinkedList lst, but it should not add an object that is already in lst 
		 * (as determiend by the contains method). Can assume both of the original lists have 
		 * no duplicates.
		 */ 

		}
		
		
	}

}
