+0  
 
+20
796
1
avatar+1886 

Compute how many steps binary search would take to find an item in arrays of various sizes.

 Oct 25, 2016

Best Answer 

 #1
avatar+118704 
+5

let 

T0=2,T1=3T14=47,T15=53,...T63=311

 

About 7 

 

T(0.5(0+63))=T31=toobigT(0.5(0+31))=T15=53=toobigT(0.5(0+15))=T7=19=toosmallT(0.5(7+15))=T11=37=toosmallT(0.5(11+15))=T13=43=toosmallT(0.5(13+15))=T14=47=toosmallT(0.5(14+15))=T14=47=ummalreadyseenthatone.Conclusions: 52 is not a prime number

 Oct 25, 2016
 #1
avatar+118704 
+5
Best Answer

let 

T0=2,T1=3T14=47,T15=53,...T63=311

 

About 7 

 

T(0.5(0+63))=T31=toobigT(0.5(0+31))=T15=53=toobigT(0.5(0+15))=T7=19=toosmallT(0.5(7+15))=T11=37=toosmallT(0.5(11+15))=T13=43=toosmallT(0.5(13+15))=T14=47=toosmallT(0.5(14+15))=T14=47=ummalreadyseenthatone.Conclusions: 52 is not a prime number

Melody Oct 25, 2016

1 Online Users

avatar