Question: Language is C++ sorting time 1. Implement Selection Sort algorithm in a function with the function prototype void selectionsort (std::vector int> cv); and test it
Language is C++
sorting time
1. Implement Selection Sort algorithm in a function with the function prototype void selectionsort (std::vector int> cv); and test it on a small vector of integers. 2. Implement the Quick Sort algorithm in a function with the function prototype void quicksort(std::vector sv); 3. Implement the Merge Sort algorithm in a function with the function prototype void merge Sort(std::vector cv) When you are given a function prototype (as an interface for a function), you must use the function prototype given. However, you are free to overload the function to suit your algorithm. 4. Now, using the using the rand() function, generate arrays of random 15 bit integers for na 1000, 2000, 4000, 8000, 16000, 32000. Time how long selectionsort, quicksort and merge Sort take. To get an accurate measure for the time for small values of n, you will need to repeat the experiment m times, that is, time how long it takes to sort an array of n values m times and then divide the total time T by m. For example, for n=1000, you may need to repeat the experiment 100 times so that the total time is at least 1 time unit. For the fast algorithms, you may need to use m=1000 or more, to get an accurate time T. 5. Now let Sin) be the time it takes to sort n elements for selectionsort Let Qin) be the time it takes for quicksort to sort n elements. Let Min) be the time it takes for mergesort to sort n elements. In a Word document, Excel document or in a text file, create a table of the following data which your program(s) will produce using the functions you developed in 1) 2) 3) and 4). Your program should generate all these values in a single execution of the program (Yes it all take a long time to run but is much easier than running it multiple times AD ENG