diff --git a/insertion_sort/Java/insertionsort.java b/insertion_sort/Java/insertionsort.java deleted file mode 100644 index 646dba35..00000000 --- a/insertion_sort/Java/insertionsort.java +++ /dev/null @@ -1,43 +0,0 @@ -package java; -import java.util.*; -class InsertionSort -{ - /*Function to sort array using insertion sort*/ - public static void insertionsort(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; - } - } - // Driver method - public static void main(String args[]) - { - Scanner sc = new Scanner(System.in); - System.out.println("Enter the number of values :"); - int var = sc.nextInt(); - System.out.println("Enter the values :"); - int arr[] = new int[var]; - for(int i =0 ; i < var ;i++) - arr[i] = sc.nextInt(); - InsertionSort ob = new InsertionSort(); - ob.insertionsort(arr); - sc.close(); - int n = arr.length; - for (int i=0; i