Menu

Using C Implement Badstoogesort Pseudocode Sort Array Integers Value Input Parameter Progr Q43901245

Using C++

Consider the following pseudocode for a sorting algorithm, for 0 < a < 1 and n > 1. badSort(A[O...n - 1]) if (n = 2) and (A[0

Implement badStoogeSort from pseudocode to sort an array ofintegers. The value of α should be an input parameter to yourprogram. Implement the algorithm in C/C++. Your program should beable to read inputs from a file called “data.txt”, where the firstvalue of each line is the number of integers that need to besorted, followed by the integers. The output will be written to afile called “bad.out”. Then, Modify the code to collectrunning time data. Call the new timing program badStoogeSort.Instead of reading arrays from the file data.txt and sorting, youwill now generate arrays of size n containing random integer valuesfrom 0 to 10,000 to sort. Use the system clock to record therunning times of each algorithm for n = 5000, 10000, 15000, 20,000,…. for two values of α = 2/3 and α = 3/4. You may need to modifythe values of n if an algorithm runs too fast or tooslow

Consider the following pseudocode for a sorting algorithm, for 0 < a < 1 and n > 1. badSort(A[O…n – 1]) if (n = 2) and (A[0] > A[1]) swap A[0] and A[1] else if (n > 2) m = fa.nl badSort(A[O…m – 1]) badSort(A[n – m…n – 1]) badSort(A[O…m – 1]) Show transcribed image text Consider the following pseudocode for a sorting algorithm, for 0 A[1]) swap A[0] and A[1] else if (n > 2) m = fa.nl badSort(A[O…m – 1]) badSort(A[n – m…n – 1]) badSort(A[O…m – 1])

Expert Answer


Answer to Using C++ Implement badStoogeSort from pseudocode to sort an array of integers. The value of α should be an input param…

OR