Write a test program to compare the performances of selection sort, bubble sort, and heapsort algorithms experimentally. Use the random method from the Math class to generate 5000 integers, and sort the generated integers by using the three sorting algorithms. For each execution, record the time it took to sort the numbers. You can use the java.util.Date class to record the execution time in milliseconds, for example,
Date startTime, endTime;
startTime = new Date();
//sort the integers
endTime = new Date();
//record the elapsed time
double elapsedTime
= endTime.getTime() - startTime.getTime();
We need at least 10 more requests to produce the solution.
0 / 10 have requested this problem solution
The more requests, the faster the answer.