Question: Can you explain these problems, please. Its for an algorithms class. 3. (20 pts) Consider the following pseudocode of an algorithm, assuming that the input
Can you explain these problems, please. Its for an algorithms class.


3. (20 pts) Consider the following pseudocode of an algorithm, assuming that the input is an Integer array A[1..n), where n is a power of 2. AWNA Some Algo(A) n--length[A] if n=1 then return A[1] for i = 2 ton do A[i] - A[i] - A[i 1] if A[n/2] > 0 return A[n/2] else return A[n] 600 V (a) (10 pts) Analyze running time of the above algorithm SomeAlgo and give the best bounds as you can on the running time of the algorithm. (b) (5 pts) Now assuming that lines 7 and 9 are replaced with 7 9 return SOMEALGO(A[1..n/2]) return SOMEALGO(A[in/2 + 1)..n)) Give the recurrence that represents the running time of the algorithm. (c) (5 pts) Determine the running time of the algorithm SOMEALGO by solving the recurrence you gave in (b)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
