class InsertionSort
{
	void sort(int arr[])
	{
		int n = arr.length;
		for (int i=1; i<n; ++i)
		{
			int key = arr[i];
			int j = i-1;
			while (j>=0 && arr[j] > key)
			{
				arr[j+1] = arr[j];
				j = j-1;
			}
			arr[j+1] = key;
		}
	}

	static void printArray(int arr[])
	{
		int n = arr.length;
		for (int i=0; i<n; ++i)
		{
			System.out.print(arr[i] + " ");
		}
		System.out.println();
	}

	public static void main(String args[])
	{        
		int arr[] = {12, 11, 13, 5, 6};

		InsertionSort ob = new InsertionSort();        
		ob.sort(arr);

		printArray(arr);
	}
} 
@@ -1,8 +1,29 @@
+import java.util.*;%0A%0A
 class In
@@ -469,40 +469,263 @@
  %0A%09%09
-int arr%5B%5D = %7B12, 11, 13, 5, 6%7D;%0A
+Scanner S = new Scanner(System.in);%0A%09%09System.out.println(%22Enter the size of your array: %22);%0A%09%09int n = S.nextInt();%0A%09%09int arr%5B%5D = new int%5Bn%5D;%0A%09%09System.out.println(%22Enter the elements of the array: %22);%0A%09%09for(int i=0;i%3Cn;i++)%0A%09%09%7B%0A%09%09%09arr%5Bi%5D = S.nextInt();%0A%09%09%7D
 %0A%09%09I
@@ -787,17 +787,62 @@
 t(arr);%0A
+%09%09System.out.println(%22The sorted array is:%22);
 %0A
-
 %09%09printA
@@ -859,6 +859,7 @@
 %0A%09%7D%0A
-
 %7D 
+%0A

Update insertion_sort.java