Question: 1. Consider the following recursive function F(int n) int F(int n) { if (n=1) return 1; else { int x = F(n/2)+F(n/2); G(n, x);
1. Consider the following recursive function F(int n) int F(int n) { if (n=1) return 1; else { int x = F(n/2)+F(n/2); G(n, x); // assume function G(n, x) is defined } (a) Assume the running time of function G(n, x) is O(1). Setup recurrence for function F(n), then solve the recurrence using the master theorem. (b) Repeat (a) if the running time of G(n, x) is O(n). (c) Repeat (a) if the running time of G(n, x) is O(n).
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
