Question: Selection sort (recursive) Insertion sort (non-recursive) Merge sort (recursive) and do the following with the implementations: Create an array of size 25 and fill it

Selection sort (recursive) Insertion sort (non-recursive) Merge sort (recursive) and do the following with the implementations: Create an array of size 25 and fill it with the values from 25 to 1 in the following way: on the first position you will have the value 25, on the second position you have the value 24, on the next position you have 23 and so on until the last slot in the array contains the value 1. Run a statement like the following to "sort" the array that is containing the values in the decreasing order: long startTime = System.currentTimeMillis(); methodA(25); long endTime = System.currentTimeMillis(); System.out.println("That method A for 25 took " + (endTime - startTime) + " milliseconds"); Do the same for methods B and C. Give the time needed for each of the three sorting implementations Then go ahead and run the same with an array of 10,000,000 elements still arranged from the largest value 10,000,000 through 1 and submit also the output in miliseconds. Your submission for part a should be the java file/files for solving the problem, an actual list of the running times for all the 3*2 possibilities (3 algorithm*2 imputs each) part b. 2p Implement Shell Sort in a non-recursive manner in Java. Your submission for part b should be the java file/files for solving the problem. part c. 2p Implement a method that would compute the n-th Fibonacci number https://en.wikipedia.org/wiki/Fibonacci_number Estimate the complexity in time and space of your implementation Your submission for part c should be a Java file as well as a word/txt/jpg file that is estimating the complexity of the implemented method

Step by Step Solution

3.37 Rating (144 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Heres a Java implementation for the sorting algorithms and the Fibonacci number computation method import javautilArrays public class SortingAlgorithm... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!