Question: Write a C++ code the does the following: Implement a quick sort algorithm that will accept an integer array of size n and in random
Write a C++ code the does the following:
- Implement a quick sort algorithm that will accept an integer array of size n and in random order.
- Develop or research three different approaches as how you can pick the pivot.
- Write the code so the quick sort can choose among the above three different ways of picking the pivot.
- Run the algorithm for different sets of random data and make sure that for each set of data, you run the algorithm with all three options for the pivot selection.
- Record the number of key operations for each case.
- Report the numbers in a way that will allow you to draw a conclusion about which pivot selection approach was more efficient and how much variations you see between the different runs.
You should submit your C++ source code along with screen shots of sample runs that showed successful runs for the above steps.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
