Java Applets Centre
Merge Sort


Description
This applet demonstrates the working of the Merge Sort algorithm.


Code

void mergeSort(int first, int last){
  int mid;
  if(first==last) return;
  mid=(first+last)/2;
  mergeSort(first,mid);
  mergeSort(mid+1,last);
  mergeArray(first,mid,last);
}


Data Structures and Algorithms
Java Applets Centre


R. Mukundan
Department of Computer Science
University of Canterbury
Private Bag 4800, Christchurch
New Zealand.