Q.1. A) If you increase the size of a data set hundred-fold, how much longer does it take to sort it with the following sort algorithms?
1) Insertion sort
2) Merge sort
B) Consider the selection sort. When sorting an array of strings, what is the result of the next step?
an Dreams Interoperability Yes, I will do it later What?
Q.2. Use StopWatch.java class to measure execution time of the following algorithm, MergeSorter.java and QuickSorter.java (from your book). To do that, write a tester program to examine the time needed to sort an array (randomly filled) at the following size:
Array of size 100
Array of size 10000
Array of size 1000000
you must examine arrays with same data, you can use copyOf(int[] original, int newLength) method form Arrays class, to copy the data inside the array.
The output should look like this:
Array of Size 100
Merge Sort: Elapsed time: 1 milliseconds
Quick Sort: Elapsed time: 1 milliseconds
Array of Size 10000
Merge Sort: Elapsed time: 1 milliseconds
Quick Sort: Elapsed time: 1 milliseconds
Array of Size 1000000
Merge Sort: Elapsed time: 4 milliseconds
Quick Sort: Elapsed time: 4 milliseconds
Q.3. Write a Java program to sort the following numbers using quicksort
24,2,45,20,56,75,2,56,99,53,12