Question: Consider the following procedure unknown: unknown ( A , L , r ) : if l > r then return infty else if l

Consider the following procedure unknown:
unknown (A,L,r):
if l>r then return \infty
else if l= r then return A[l]
else
9=1+1(r-1)/41
ansL = unknown(A,1, q)
ansR = unknown(A q+1, r)
if ansl < ansk return ansl
else
return ansR
endif endif
that takes as input an array A[l.. r] of n = r -1+1 numbers, with the left-index I
and the right-index r. Let A[O.6]={6,1,3,8,4,7,53. What does a call to
unknown (A,0,6) return, what does this value represent, and what is the time-complexity of unknown (use the smallest possible class of functions)?
Select one:
1, the minimum, O(n?)
1, the minimum, O(n)
5, the median, O(n?)
5, the median, O(n)
8, the maximum, O(n?)
8, the maximum, O(n)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!