Using Replit I need to test 5 common sorting algorithms in a C program. Code is listed in the attached. Also need information for readme.txt file.
You are provided with a C program that implements and tests 5 common sorting algorithms. The sorting algorithms themselves have been removed. You are required to re-implement them so the program works.
You will implement four sort algorithms from the lecture/readings. Implement the algorithms as described in the lecture or your will not receive full credit.
The following files are provided:
The sort.c file has one remaining sort called Gnome Sort. It is provided as an example. You will implement Insertion Sort, Bubble Sort, Merge Sort, and Quick Sort in this file.
Example Execution
You can run the code and it will provide a menu. You can collect timings or test one of the sorts.
If one of your algorithms fails, information about what went wrong will be printed.
Example 1
Select Which Test to Run:
0.) Time All Algorithms
1.) Test Bubble Sort
2.) Test Insertion Sort
3.) Test Merge Sort
4.) Test Quick Sort
5.) Test Gnome Sort
1
Testing Bubble Sort
Enter Size of Arrays to Test:
10
Enter Number of Tests to Run:
15
Passed 15 out of 15 tests.
Example 2
Select Which Test to Run:
0.) Time All Algorithms
1.) Test Bubble Sort
2.) Test Insertion Sort
3.) Test Merge Sort
4.) Test Quick Sort
5.) Test Gnome Sort
3
Testing Merge Sort
Enter Size of Arrays to Test:
7
Enter Number of Tests to Run:
9
Passed 9 out of 9 tests.
Example 3
Select Which Test to Run:
0.) Time All Algorithms
1.) Test Bubble Sort
2.) Test Insertion Sort
3.) Test Merge Sort
4.) Test Quick Sort
5.) Test Gnome Sort
5
Testing Gnome Sort
Enter Size of Arrays to Test:
10
Enter Number of Tests to Run:
100
Passed 100 out of 100 tests.
Timings
Once All your algorithms work correctly, run the program and select 0 to collect timings.
Place the output of the program in a file readme.txt
Below the timings answer the following questions:
Template Table
Size |
Gnome |
Bubble |
Insert |
Merge |
Quick |
8 |
? |
? |
? |
? |
? |
16 |
? |
? |
? |
? |
? |
32 |
? |
? |
? |
? |
? |
64 |
? |
? |
? |
? |
? |
128 |
? |
? |
? |
? |
? |
256 |
? |
? |
? |
? |
? |
512 |
? |
? |
? |
? |
? |
1024 |
? |
? |
? |
? |
? |
2048 |
? |
? |
? |
? |
? |
4096 |
? |
? |
? |
? |
? |
8192 |
? |
? |
? |
? |
? |
16384 |
? |
? |
? |
? |
? |
32768 |
? |
? |
? |
? |
? |
65536 |
? |
? |
? |
? |
? |
131072 |
? |
? |
? |
? |
? |