Source of 15.11.java


  1: // @author Frank M. Carrano, Timothy M. Henry
  2: // @version 5.0
  3: public static <T extends Comparable<? super T>>
  4:        void insertionSort(T[] a, int first, int last)
  5: {
  6:    if (first < last)
  7:    {
  8:       // Sort all but the last entry
  9:       insertionSort(a, first, last - 1);

 11:       // Insert the last entry in sorted order
 12:       insertInOrder(a[last], a, first, last - 1); 
 13:    } // end if
 14: } // end insertionSort