Question: You are given the following pseudocode for an algorithm: 1 method1(n) 123 if n==0 2 3 return 0 45 else 5 return method2(n-1, n-1)

You are given the following pseudocode for an algorithm: 1 method1(n) 123 if n==0 2 3 return 0 45 else 5 return method2(n-1, n-1) - (n-1) 6 method2 (m, k) if m==0 return method1(k) 7 8 9 else 10 return 1 + method 2 (m-1, k) a. What would be the output for the following method call? System.out.println(method 1(4)); b. Please provide the recurrence form for the running time function of this algorithm. c. Please find the growth rate of the algorithm in Big-O notation.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
