Question
write a java program that calculates the running time of variouos sorting algorithms like heap sort, in-place quick sort and merge sort for 10,000 randomly
write a java program that calculates the running time of variouos sorting algorithms like heap sort, in-place quick sort and merge sort for 10,000 randomly generated integer no. Since you are using random numbers, you need to repeat your experiments 10 times to be able to compute the average running time. So you are required to generate 10,000 integers, and compute the minimum, maxi and avge time required to sort the data. Your generated random data should be between 0 to 100,000. Hint :
Heap sort, in-place quick sort and merge sort algorithms are available in the book and the companion website of the book. You are NOT required to implement the algorithm with a generic type. It is enough for this assignment that your sorting algorithms work for integer data only. Use the following code to compute the running time:
long startTIme = System.currentTimeMillis();
long endTime = System.currentTimeMillis();
long elapsed = endTime - startTime;
Please provide a working java code, would appreciate if you can attach the .java file here, Thanks!
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started