Merge Sort Program

Merge sort works as follows.
  public void mergeSort(int idx1, int idx2) {
    if (idx1 == idx2) {
      return;
    }
    int middleIdx = (idx1 + idx2) / 2;
    mergeSort(otherBuffer, idx1, middleIdx);   
    mergeSort(otherBuffer, middleIdx + 1, idx2);
  }
Merge Sort
Source Code of the MergeSort Program
Source Code of the MergeSortG Program (Graphical Version)
Back
Home