Question: In c language you will implement a program to compare the performance of various sorting algorithms based on what you have learnt about sorting algorithms.

In c language you will implement a program to compare the performance of various sorting algorithms based on what you have learnt about sorting algorithms. Your program should include at least 4-sorting algorithms and compare their results. However, only one of the selected algorithms can have a time complexity of O(N2) and the others should be faster. Your program should generate random arrays of data and compare their results as follows: 1. The user shall be given the following options to generate the randomly filled arrays with elements that are: a. Sorted b. Random c. Reversed Order 2. Then the program should generate arrays with the following sizes be sorted (based on the strategy selected in the previous step): a. 1,000 b. 10,000 c. 100,000 d. 1,000,000 3. Select one (or more) sorting algorithm to sort the arrays with. 4. Generate a report (into a file) containing the run-time of the selected sorting algorithms on the specified arrays (with their sizes and initial element strategy). Once the user has selected these options, your program should run the sorting algorithms on the specified arrays with their specified sizes and initial state. Your program should compute the actual time (in seconds) of execution to sort the arrays. The data can be printed as follows: n Sort 1,000 10,000 100,000 1,000,000 Algorithm1 Time Algorithm2 Algorithm3 In the submission of this assignment, you have to include a report (in a word document format) containing: 1. What is the best sort algorithm (and why?) for the following scenarios: a. When n size is small and the initial state of the elements is i. Sorted ii. Random iii. Reverse order b. When n size is large and the initial state of the elements is i. Sorted ii. Random iii. Reverse order 2. A table of the results of running all sorting algorithms on all size options using all possible strategies as explained above. Please note that your report should be names P4-XXXXXXX-report.docx and your code should be named P4-XXXXXXX.c, where XXXXXXX is your student ID. Please note that any file not following this convention will not be marked.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock 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 Databases Questions!