util
Class MergeSort

java.lang.Object
  extended by util.MergeSort

public abstract class MergeSort
extends Object

An implementation of MergeSort, needs to be subclassed to compare the terms.

Author:
Scott Violet

Field Summary
protected  Object[] swapSpace
           
protected  Object[] toSort
           
 
Constructor Summary
MergeSort()
           
 
Method Summary
abstract  int compareElementsAt(int beginLoc, int endLoc)
           
protected  void merge(int begin, int middle, int end)
           
protected  void mergeSort(int begin, int end)
           
 void sort(Object[] array)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

toSort

protected Object[] toSort

swapSpace

protected Object[] swapSpace
Constructor Detail

MergeSort

public MergeSort()
Method Detail

sort

public void sort(Object[] array)

compareElementsAt

public abstract int compareElementsAt(int beginLoc,
                                      int endLoc)

mergeSort

protected void mergeSort(int begin,
                         int end)

merge

protected void merge(int begin,
                     int middle,
                     int end)