import java.util.*; class InsertSort5 // Destructive insertion sort on a random ArrayList of integers // Timed but not printed { public static void main(String[] args) throws Exception { Random rand = new Random(); long time1,time2; Scanner input = new Scanner(System.in); System.out.print("Enter the number of numbers: "); int num = input.nextInt(); System.out.print("Enter the highest number: "); int high = input.nextInt(); ArrayList a = new ArrayList(); for(int i=0; i a) { for(int i=1; i a,int i) { for(; i>0&&a.get(i-1).compareTo(n)>0; i--) a.set(i,a.get(i-1)); a.set(i,n); } }