Question: Consider the following recursive algorithm: ALGORITHM Secret ( A , lowIdx, highIdx ) / / Input: / / - An array A [ 1 .
Consider the following recursive algorithm:
ALGORITHM Secret A lowIdx, highIdx
Input:
An array An of integer numbers
integers lowIdx, highIdx
Variables:
integers midIdx, temp temp
if lowIdx highIdx
return lowIdx
else
midIdx lowIdxhighIdx
temp Secret A lowIdx, midIdx
temp Secret A midIdx highIdx
if Atemp Atemp
return temp
else
return temp
a points What does this algorithm return?
b points Set up a recurrence relation for the algorithms running time and solve it
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
