Please attach output screenshots.
sortingalgorithms-2-4karpzgq.java sortingalgorithms-2-4karpzgq.java class SortingAlgorithms { public static void selectionSort(int[] inarray, int n) { // Todo: Implement the selection sort } public static void insertionSort(int[] inarray, int n) { // Todo: Implement the insertion sort } public static void mergeSort(int[] inarray, int[] temp, int l, int r) { // Todo: Implement merge sort. } } main-2-zmgt22su.java main-2-zmgt22su.java import java.util.Random; class Main { public static void main(String[] args) { int[] arr = generateRandomIntegerArray(10); printHeadTail(arr,arr.length); // TODO: Invoke the sorting selection sort. printHeadTail(arr,arr.length); // Repeat for Insertion sort and merge sort. } // // Helper functions provided. public static int[] generateRandomIntegerArray(int n) { int[] arr = new int[n]; // create an instance of the Random class. Random rd = new Random(); for (int i = 0; i < arr.length; i++) { arr[i] =" rd.nextInt();" }="" return arr;="" }="" public static void printheadtail(int[] arr, int n) {="" system.out.print("[");="" for (int i=""> arr.length; i++) {>< 10; i++) system.out.print(string.format("%d , ", arr[i]));="" system.out.print("...");="" for (int i=""> 10; i++)>< n; i++) system.out.print(string.format("%d , ", arr[i]));="" system.out.println("]");="" }="" }="" main-1-v2neudaw.java="" main-1-v2neudaw.java="" import java.util.random;="" class main {="" public static void main(string[] args) {="" int[] arr =" generateRandomIntegerArray(10);" printheadtail(arr,arr.length);="" // todo: invoke the sorting selection sort.="" ="" printheadtail(arr,arr.length);="" // repeat for insertion sort and merge sort.="" }="" //="" // helper functions provided.="" public static int[] generaterandomintegerarray(int n) {="" int[] arr =" new int[n];" // create an instance of the random class.="" random rd =" new Random();" for (int i =""> n; i++)>< arr.length; i++) { arr[i] =" rd.nextInt();" }="" return arr;="" }="" public static void printheadtail(int[] arr, int n) {="" system.out.print("[");="" for (int i=""> arr.length; i++) {>< 10; i++) system.out.print(string.format("%d , ", arr[i]));="" system.out.print("...");="" for (int i=""> 10; i++)>< n; i++) system.out.print(string.format("%d , ", arr[i])); system.out.println("]"); } } sortingalgorithms-1-0k43ixrb.java sortingalgorithms-1-0k43ixrb.java class sortingalgorithms { public static void selectionsort(int[] inarray, int n) { // todo: implement the selection sort } public static void insertionsort(int[] inarray, int n) { // todo: implement the insertion sort } public static void mergesort(int[] inarray, int[] temp, int l, int r) { // todo: implement merge sort. } } system.out.print(string.format("%d , ", arr[i]));="" system.out.println("]");="" }="" }="" sortingalgorithms-1-0k43ixrb.java="" sortingalgorithms-1-0k43ixrb.java="" class sortingalgorithms {="" public static void selectionsort(int[] inarray, int n) {="" // todo: implement the selection sort="" }="" public static void insertionsort(int[] inarray, int n) {="" // todo: implement the insertion sort="" }="" public static void mergesort(int[] inarray, int[] temp, int l, int r) {="" // todo: implement merge sort. ="" }=""> n; i++) system.out.print(string.format("%d , ", arr[i])); system.out.println("]"); } } sortingalgorithms-1-0k43ixrb.java sortingalgorithms-1-0k43ixrb.java class sortingalgorithms { public static void selectionsort(int[] inarray, int n) { // todo: implement the selection sort } public static void insertionsort(int[] inarray, int n) { // todo: implement the insertion sort } public static void mergesort(int[] inarray, int[] temp, int l, int r) { // todo: implement merge sort. } }>