Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

In Java Please(Other Java Code does not Work from other question page)-Create an

ID: 3697658 • Letter: I

Question

In Java Please(Other Java Code does not Work from other question page)-Create an integer array of size of 10. Randomly populate the array with integer from 1 to 100 into the array.

Apply Selection Sort to the unsorted array. Create a counter to count the number of iteration needed to complete the sort of of the array. Display the result of the array after the sort, and the counter.

Apply Merge Sort to the unsorted array. Create a counter to count the number of iteration needed to complete the sort of of the array. Display the result of the array after the sort, and the counter.

Explanation / Answer

import java.io.IOException; class Test { public static void main(String[] args) throws IOException { int[] arr1 = getArray(10); System.out.println(" "); doTest(arr1); } public static void doTest(int[] arr){ System.out.println("SelectionSort :"+selectionSort(arr)); System.out.println("MergeSort :"+(new MergeSort()).sort(arr)); } public static int[] getArray(int n){ int[] arr = new int[n]; for(int i=0; i
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote