diff --git a/insertion_sort/Java/insertion_sort.java b/insertion_sort/Java/insertion_sort.java index 6a093862..3435c193 100644 --- a/insertion_sort/Java/insertion_sort.java +++ b/insertion_sort/Java/insertion_sort.java @@ -1,34 +1,31 @@ -class InsertionSort -{ - public static void sort(int arr[]) - { - int n = arr.length; - for (int i=1; i=0 && arr[j] > key) - { - arr[j+1] = arr[j]; - j = j-1; - } - arr[j+1] = key; - } - } - public static void printArray(int arr[]) - { - int n = arr.length; - for (int i=0; i=0 && arr[j] > key) + { + arr[j+1] = arr[j]; + j = j-1; + } + arr[j+1] = key; + } + } + public static void printArray(int arr[]) + { + int n = arr.length; + for (int i=0; i