InsertionSortDemo.java.html

  1  import java.util.Arrays;
  2  
  3  /**
  4     This program demonstrates the insertion sort algorithm.
  5  */
  6  public class InsertionSortDemo
  7  {  
  8     public static void main(String[] args)
  9     {  
 10        int[] a = ArrayUtil.randomIntArray(20, 100);
 11        System.out.println(Arrays.toString(a));
 12  
 13        InsertionSorter.sort(a);
 14  
 15        System.out.println(Arrays.toString(a));
 16     }
 17  }