search in the number guessing gamewith range from to it takes maximum of seven guesses to identify any number using binary searchjust as in an array of recordsit takes seven comparisons to find record with specified key value how about other rangestable shows some representative ranges and the number of comparisons needed for binary search table comparisons needed in binary search ange comparisons needed , , , , , , , , , , , , notice the differences between binary search times and linear search times for very small numbers of itemsthe difference isn' dramatic searching items would take an average of five comparisons with linear search ( / )and maximum of four comparisons with binary search but the more items there arethe bigger the difference with itemsthere are comparisons in linear searchbut only seven in binary search for , itemsthe numbers are versus and for , , itemsthey're , versus we can conclude that for all but very small arraysthe binary search is greatly superior the equation you can verify the results of table by repeatedly dividing range (from the first columnin half until it' too small to divide further the number of divisions this process requires is the number of comparisons shown in the second column repeatedly dividing the range by two is an algorithmic approach to finding the number of comparisons you might wonder if you could also find the number using simple equation of coursethere is such an equation and it' worth exploring here because it pops up from time to time in the study of data structures this formula involves logarithms (don' panic yet