Question: Selection Sort and Heap Sort: (C++) Create an array of random numbers within the range -99 to 99 of a given size. Sort it using

Selection Sort and Heap Sort: (C++)

Create an array of random numbers within the range -99 to 99 of a given size. Sort it using the selection sort algorithm. Sort the same array using the heap sort algorithm. If the size of the array is less than or equal to 100, print the arrays before and after sorting (for both selection and heap sort). Change both algorithms to keep track of the number of data comparisons and data moves. Save these results. Repeat the process with other arrays. Then write short report to compare the results.

Suggested arrays sizes for testing: 10 10 100 100 1000 1000 10000 10000 100000 100000.

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!