Question: (1) The following algorithm is a recursive algorithm which computes anba Let the the algorithm and its multiplication be the basic operation i cost is

(1) The following algorithm is a recursive algorithm which computes anba Let the the algorithm and its multiplication be the basic operation i cost is 1. Also let T(n) be the running time of the algorithm with respect to the input n. Please write down steps as detail as possible to show T(n) Olgn Pover (n, a, b) if (n=4) return 1; else if (n1) return a b+b; else if (n is even) Poer (n/2, a, b) return y*y: else I/ n is odd Poer ((n-1)/, a, b) return y*y*a*b*b
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
