Question: Task: Write a class, namely sorting, that contains at least seven functions: ( 1 ) constructor that initializes all the data members if any; (
Task:
Write a class, namely sorting, that contains at least seven functions: constructor that initializes all the data members if any; start function that reads the data size and maximum number in the list from the keyboard, then generates data set, then call a proper function to sort; selection sort function that carries out a selection sort and counts how many comparisons and moves; insertion sort that conducts an insertion sort and counts how many comparisons and moves; quick sort function that does a quick sort and counts how many comparisons and moves; merge sort function that performs a merge sort and counts how many comparisons and moves; and print function that prints the first elements of the sorted list and the sorting results.
REQUIREMENTS:
You must have a program design file you may suffer percent penalty if you failed to do so
You must have a readme file that instructs readers how to compile and run your program you may suffer percent penalty if you failed to do so
You must comment your program properly including proper comments and program synopsis. you may suffer percent penalty if you failed to do so
You must put your functions and variables together to form a classSorter
You must turn on a copy of the output of your program
This project is optional and it will earns you points extra credit if you do it successfully.
A late project will NOT be accepted and No exceptions.
Design:
You use the general random number generator to produce a set of random numbers, and then make enough copies for your sorting algorithms. Then sends a copy of the list to each of sorting algorithms. Finally, each algorithm produces a sorting report.
Input:
Your program needs two integers from keyboard: the size of list and maximum number in your list.
Output:
The first elements in the sorted list, # of comparisons from each sorting algorithm.
Your one runs output may look like:
Enter list size:
Enter max number in the list:
Unsorted list:
Sorted List:
Select Sort:
Insertion Sort:
Quick Sort:
Merge Sort:
Sorting Results:
Algorithm Comparisons
Select
Insertion
Quick
Merge
Your main function may look like:
int main
sorter mysort;
mysort.start;
return ;
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
