utilize the code below to sort an unsorted integer array of size40 of random numbers in the range 0-1000 . The main method shoulddisplay the unsorted array and sorted array after nSort.
public static void nSort(int Larray). int unsortedValue; int scan: for (int i = 1; i < array.length; i++) unsortedValue = array[i]. scan = i; while( scan > 0 && array(scan-1] > unsortedValue) array(scan) = array(scan-1); scan–; array[scan] = unsortedValue; Show transcribed image text public static void nSort(int Larray). int unsortedValue; int scan: for (int i = 1; i 0 && array(scan-1] > unsortedValue) array(scan) = array(scan-1); scan–; array[scan] = unsortedValue;
Expert Answer
Answer to utilize the code below to sort an unsorted integer array of size 40 of random numbers in the range 0-1000 . The main met…