import java.util.Scanner;

/**
   This program measures how long it takes to remove duplicates in an
   array of a user-specified size with the 2nd duplicate remover
   algorithm.
*/
public class DuplicateRemove2Timer
{  
   public static void main(String[] args)
   {  
      Scanner in = new Scanner(System.in);
      System.out.print("Enter array size: ");
      int n = in.nextInt();

      // Construct random array
   
      int[] a = ArrayUtil.randomIntArray(n, n);
      DuplicateRemover2 remover = new DuplicateRemover2(a);
      
      // Use stopwatch to time duplicate removal
      
      StopWatch timer = new StopWatch();
      
      timer.start();
      remover.removeDups();
      timer.stop();
      
      System.out.println("Elapsed time: " 
            + timer.getElapsedTime() + " milliseconds");
   }
}

   
