Menu

(Solved) : 9 X Points Mystery Sort Algorithm Def Mysterysort Line1 N Len Line2 Range 1 N Line3 Line4 Q44142646 . . .

9. [X points) Below is a mystery sort algorithm. def mystery_Sort(a): Line1: n = len(a) Line2: for i in range(1, n): Line3: i

9. [X points) Below is a mystery sort algorithm. def mystery_Sort(a): Line1: n = len(a) Line2: for i in range(1, n): Line3: i = i Line4: while (j > 0) and (a[j] <alj – 1]): Line5: alj), a[j-1]=a[j-1], a[j] Line6 : j -= 1 a. This is sort. T(n) for the wort case is OO T(n) for the average case is e T(n) for the best case is 20 ) ) ) b. If the input is already sorted which lines never get to be executed? (Just write the line numbers) 10. Fill in the blanks. a. Worst case for Merge Sort is 8 ) b. Average case for Binary search is e c. Space complexity for Merge Sort is e( ) d. Recall the find_min algorithm discussed in class. Worst case for Finding a minimum element in a sequence is O( ) Show transcribed image text 9. [X points) Below is a mystery sort algorithm. def mystery_Sort(a): Line1: n = len(a) Line2: for i in range(1, n): Line3: i = i Line4: while (j > 0) and (a[j]

Expert Answer


Answer to 9. [X points) Below is a mystery sort algorithm. def mystery_Sort(a): Line1: n = len(a) Line2: for i in range(1, n): Lin…

OR