Insertion Sort on array of 100000 keys
===

Now i am running an insertion sort on the array of 10000 randoms numbers. when i run i don't get any result/output .But if i decrease the size of the array to 100 i get the result. Any idea?The code is below:

    

     import java.util.Random;

     public class Insertion{
     public static void main(String a[]){
     int i;
  
     int[] arr = new int [10000];
     Random randomGenerator = new Random();
     for (int idx = 0; idx < 10000; ++idx){
      arr [idx]= randomGenerator.nextInt(100000);
     }
  
     System.out.println("\n\n Straight Isertion sort\n\n");
     System.out.println(" Result Sort\n\n"); 
     System.out.println("Values Before the sort:\n");  
  
    for(i = 0; i < arr.length; i++)
    System.out.print( arr[i]+"  ");
    System.out.println();
  
    insertion_srt(arr, arr.length);  
    System.out.print("Values after the sort:\n"); 
  
    for(i = 0; i <arr.length; i++)
    System.out.print(arr[i]+"  ");
    System.out.println(); 
    System.out.println("PAUSE"); 
     }

    public static void insertion_srt(int arr[], int n){
    for (int i = 1; i < n; i++){
    int j = i;
    int B = arr[i];
    while ((j > 0) && (arr[j-1] > B)){
    arr[j] = arr[j-1];
    j--;
    }
    arr[j] = B;
     }
     }
    }


output: 
