siuying.gm.app.gmailer4j.model.treetable
Class MergeSort

java.lang.Object
  extended by siuying.gm.app.gmailer4j.model.treetable.MergeSort

public abstract class MergeSort
extends java.lang.Object

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

Author:
Scott Violet

Field Summary
protected  java.lang.Object[] swapSpace
           
protected  java.lang.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(java.lang.Object[] array)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

toSort

protected java.lang.Object[] toSort

swapSpace

protected java.lang.Object[] swapSpace
Constructor Detail

MergeSort

public MergeSort()
Method Detail

sort

public void sort(java.lang.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)