Question: Sorting Program (c++) For this assignment, you are to write a comparative algorithm that will compare the efficiency of three sorting routines. Here is the

Sorting Program (c++) For this assignment, you are to write a comparative algorithm that will compare the efficiency of three sorting routines. Here is the approach you should use: 1. Write a Bubble Sort function with a test program. 2. Write a Shell Sort function with a test program. 3. Write a Quick Sort function (using stacks, rather than recursion) with a test program. 4. Write the main program (that will include the other 3 programs). Notes: In the test programs, the logic should be as follows: Print the random numbers Sort the numbers keeping track of the costs Print the sorted numbers Print the cost Use __INCLUDE_LEVEL__ in all of the programs, which includes the sorting routines and a test program. ( Sample program using include level) The main program should have the following logic. Generate 20 random numbers. Print the random numbers. Move the original random numbers into another array. Bubble Sort the other array. Print the sorted numbers AND the cost of sorting the numbers. Move the original random numbers into another array. Shell Sort the other array. Print the sorted numbers AND the cost of sorting the numbers. Move the original random numbers into another array. Quick Sort the other array. Print the sorted numbers AND the cost of sorting the numbers. To compute the cost, you assign values to every swap and every compare. A compare costs 1 unit, and a swap costs 6 units.

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!