Question
Create a program named sort.java that reads in primes1.txt. Sort these numbers using bubble, selection, merge, and radix sorts. Each sort should list the elapsed
Create a program named sort.java that reads in primes1.txt. Sort these numbers using bubble, selection, merge, and radix sorts. Each sort should list the elapsed time, iterations, and print the first 10 and last 10 numbers in the sorted array.
Example output
This program compares the bubble, selection, merge, and radix sorts.
The data set is 100000 prime numbers unsorted
1. Bubble Sort Seconds to sort = ???
Number of iterations = ???
First 10 - 2 3 5 7 11 17 23 29 31 37
Last 10 - 1299553 1299583 1299601 1299631 1299637 1299647 1299653 1299673 1299689 1299709
2. Selection Sort Seconds to sort = ???
Number of iterations = ???
First 10 - 2 3 5 7 11 17 23 29 31 37
Last 10 - 1299553 1299583 1299601 1299631 1299637 1299647 1299653 1299673 1299689 1299709
3. Merge Sort Seconds to sort = ???
Number of iterations = ???
First 10 - 2 3 5 7 11 17 23 29 31 37
Last 10 - 1299553 1299583 1299601 1299631 1299637 1299647 1299653 1299673 1299689 1299709
4. Radix Sort Seconds to sort = ???
Number of iterations = ???
First 10 - 2 3 5 7 11 17 23 29 31 37
Last 10 - 1299553 1299583 1299601 1299631 1299637 1299647 1299653 1299673 1299689 1299709
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