I would appreciate any input anyone might have for the following problem:
Describe the worst-case time complexity, measured in terms of comparisons, of the following searching algorithm:
(x: increasing integer a1, a2, a3.... an)
i=1//left end point
j=n//right end point
while (i<j)
t=[ (i+j/3) ]
begin
if ( x < t )
j=t
else if (x<2*t)
i=t
j=t*2
else
i=t*2
j=j
end
if x= ai then location i
else location = 0