Class InsertionSorter

java.lang.Object
  extended by InsertionSorter

public class InsertionSorter
extends java.lang.Object

Sort an array of integers using insertion sort

Version:
July 2003
Author:
Todd A. Whittaker

Constructor Summary
InsertionSorter()
           
 
Method Summary
 int[] sort(int[] arr, int left, int right)
          Sort an array between left and right indices using insertion sort
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

InsertionSorter

public InsertionSorter()
Method Detail

sort

public int[] sort(int[] arr,
                  int left,
                  int right)
Sort an array between left and right indices using insertion sort

Parameters:
arr - the array to sort
left - the left index for sorting
right - the right index for sorting (exclusive)
Returns:
the sorted array