Question: Analysis: (20 points) There is a mystery function called Mystery(n) and the pseudocode of the algorithm is shown as below. Please analyze the worst- case

 Analysis: (20 points) There is a mystery function called Mystery(n) and

Analysis: (20 points) There is a mystery function called Mystery(n) and the pseudocode of the algorithm is shown as below. Please analyze the worst- case asymptotic execution time of this algorithm using the method we learn in the class. Express the execution time as a function of the input value n. Assume that n 3k for some positive integer k21. Justify your answer. Hint: (a) Draw a recursion tree to help with your analysis (b) Appendix A may help with your calculation Mystery(n) 1 if n1 return 1 3 4 for i1 to!5 for j 1 to n2 print "this is a recursive call." 6 Mystery (n/3) 7 Mystery (n/3) 8 Mystery (n/3)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!