Question: Help Please! C++ for beginners ! Write a program that creates 2 identical arrays, list1, list2 of 5000 elements. The program then sorts list1 using
Help Please! C++ for beginners !
Write a program that creates 2 identical arrays, list1, list2 of 5000 elements. The program then sorts list1 using bubble sort, list2 using selection sort and outputs the number of comparisons and item assignments made by each sorting algorithm. Hint: You need to create a random array and copy it twice to end up with two identical lists (List1, List2) These two lists are identical. You will need to sort List1 using bubble sort, sort list2 using selection sort. Finally you will need to output the number of comparisons and item assignments made by each sorting algorithm. Please note that the array should be randomly generated and you can do that by using the random function: rand() from the library.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
