c++
First, you are to compare the relative performance of different sorting algorithms on the same data set. Second, you are to compare the relative performance of the same algorithm on two different data sets.
These sorting algorithms are to be tested:
(Find the code for these in our book or online.)
SelectionSort https://www.geeksforgeeks.org/selection-sort/
BubbleSort https://www.geeksforgeeks.org/bubble-sort/
InsertionSort https://www.geeksforgeeks.org/insertion-sort/
MergeSort https://www.geeksforgeeks.org/merge-sort/
Quicksort https://www.geeksforgeeks.org/quick-sort/
HeapSort https://www.geeksforgeeks.org/heap-sort/
Processing Requirements
You must modify each sort to include 2 counters, one to keep track of the number of comparisons and another to keep track of the number of swaps made.
Input
https://pastebin.com/0Te9vCC2
https://pastebin.com/XbDm7VcB
Two files of integers to be sorted. There are a maximum of 100 integers in the first data set and a maximum of 1000 integers in the second data set. (Linked above)
Output
The following output should be repeated for each sort for each file:
The name of the sort
An echo print of the input file
The sorted file
The number of comparisons required (Could be in the same file as the number of swaps)
The number of swaps required (Could be in the same file as the number of comparisons)
Deliverables
All of your source code for your program. (.cpp and .h files)
Your 2 input files. (The random number lists that you used for the sorting algorithm inputs)
Remember that your code must be appropriately commented.