Compute how many steps binary search would take to find an item in arrays of various sizes.
let
T0=2,T1=3…T14=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
let
T0=2,T1=3…T14=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