Programming Homework Help
California State University Create a Java Program Computer Programing Task
Populate an array with 100,000 integers from 1 to 1000000 – Do 4 sorts:
1) Arrays Class (Arrays.sort(arrayname)
2) Regular MergeSort from the book
3) Bubble 4 Sort from the Internet
4) Selection Sort from the Internet
Print out the run times – Before doing the sort, get the time, then the time after the sort. figure the elapsed time duration of the sort. Print out each sort name and its performance.
Next populate the array with the first 10,000 elements from 1 to 100,000, the next 10,000 from 100,000 to 200,000 then the next 300,000 to 400,000. This will partition your values in blocks. Now run all the algorithms and see if the new ordering gives an improvement.
Submit your java code running these tests.
Suggestions:
1) Start out with smaller number of array elements until code is working.
2) Have different team members work on the Bubble sort, Selection sort and populating the array.