@@ -0,0 +1,780 @@
+package sort;%0A%0A/*%0A%09This class implements insertion sort on integer Array.%0A*/%0A%0Aclass InsertionSort%7B%0A%0A%09// Sorts an array of integer specified as parameter in ascending order.%0A%09// Sorts in place%0A%09// Sort is stable%0A%09// Time Complexity: %0A%09//%09%09%09%09%09Best Case%09%09%09: O(n)%0A%09//%09%09%09%09%09Average/ Worst Case : O(n*n)%09%0A%09%0A%0A%09public static void sort(int%5B%5D A)%7B%0A%0A%09// Dont do anything if A is null%09%0A%09if(A == null)%0A%09return;%09%0A%0A%09// for elements 1 through n-1%0A%09for(int i=1; i%3CA.length; i++)%7B%0A%0A%09%09// Set key = ith element%0A%09%09int key = A%5Bi%5D;%0A%0A%09%09// Set j = i-1%0A%09%09int j = i-1;%0A%0A%09%09// Shift elements on left of j-1 (including j-1) to right if they are greater than key%0A%09%09while(j%3E=0 && A%5Bj%5D %3E key)%7B%0A%0A%09%09%09A%5Bj+1%5D = A%5Bj%5D;%0A%09%09%09j--;%0A%09%09%7D%0A%0A%09%09// Insert key in appropriate position in shifted array.%09%0A%09%09A%5Bj+1%5D = key;%09%0A%0A%09%7D%0A%0A%0A%0A%09%7D%0A%0A%7D%0A

Add Insertion Sort algorithm