Class Driver

java.lang.Object
  extended by Driver

public class Driver
extends java.lang.Object


Nested Class Summary
static class Driver.VectorType
          This enum specifies the type that Vector to be created The VectorType enum has the following values: Identical All the Integer Objects are identical in value. Random All the Integer Objects are random in value. Increasing All the Integer Objects are increasing in value. Decreasing All the Integer Objects are decreasing in value. IncreasingAndRandom 80% the Integer Objects are increasing in value, the rest are random in value.
 
Constructor Summary
Driver()
           
 
Method Summary
static void clearRunTimes()
          This method clears the array of run times to all zeros
static long[] getRunTimes()
          This method returns the array of run times that was generated by the previous call to runTestCase()
static java.util.Vector<java.lang.Integer> getVectorOfIntegers(Driver.VectorType vectorType)
          This method creates a Vector of the specified size containing Integer Objects representing identical numbers.
static void main(java.lang.String[] args)
           
static void runMergeSort(Driver.VectorType vectorType)
          This method is called to run a MergeSort on the specified type of Vector a total of ten times.
static void runQuickSort(Driver.VectorType vectorType, QuickSort.PivotType pivotType)
          This method is called to run a MergeSort on the specified type of Vector a total of ten times.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Driver

public Driver()
Method Detail

getRunTimes

public static long[] getRunTimes()
This method returns the array of run times that was generated by the previous call to runTestCase()

Returns:
the runTime array.

clearRunTimes

public static void clearRunTimes()
This method clears the array of run times to all zeros


getVectorOfIntegers

public static java.util.Vector<java.lang.Integer> getVectorOfIntegers(Driver.VectorType vectorType)
This method creates a Vector of the specified size containing Integer Objects representing identical numbers.

Parameters:
vectorType - This parameter specifies the type of Vector to create.
Returns:
The Vector containing Integer Objects as specified by vectorType

runMergeSort

public static void runMergeSort(Driver.VectorType vectorType)
This method is called to run a MergeSort on the specified type of Vector a total of ten times. The run time for each run is saved in the runTimes array.

Parameters:
vectorType - The type of vector to use for MergeSort. The choices are:
  1. Identical
  2. Random
  3. Increasing
  4. Decreasing
  5. IncreasingAndRandom

runQuickSort

public static void runQuickSort(Driver.VectorType vectorType,
                                QuickSort.PivotType pivotType)
This method is called to run a MergeSort on the specified type of Vector a total of ten times. The run time for each run is saved in the runTimes array.

Parameters:
vectorType - The type of vector to use for MergeSort. The choices are:
  1. Identical
  2. Random
  3. Increasing
  4. Decreasing
  5. IncreasingAndRandom
pivotType - The method of selecting the pivot while performing QuickSort. The choices are:
  1. FirstElement
  2. RandomElement
  3. MidOfFirstMidLastElement

main

public static void main(java.lang.String[] args)