Question: Answer the following questions about the RecMysterySort algorithm below. Input: A : array with n real numbers Input n: size of data Output: permutation of
Answer the following questions about the RecMysterySort algorithm below. Input: A : array with n real numbers Input n: size of data Output: permutation of data such that A[1]A[2]A[n] Algorithm: RecMysterySoct if n=2 then 3 if A[1]>A[2] then Swap A\{1] and A{2}. else if n>1 then first =[n/4] third =nfirst) RecMysterySort(A[I third]; RecMysterySort(Afirst.n]). RecMystery Rot(All third]); end 13 return A; a) [10 points] Write a recurrence that describes the worst case time complexity of RecMysterySort. Show your work. b) [5 points] Find the worst case time complexity of RecMysterySort. Show your work. c) [10 points] How does RecMysterySort compare to MergeSort and Insertionsort? Justify your answer. A table of approximate log values appears belowy
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
