Activity : Binary search
[1] Here is a list of key fields that a computer has to search...

10 14 19 22 28 33 41 45 57 66 69 73 80 85 94
Assuming the key to be searched for is 28...

What would be the sequence of keys accessed by the computer using...

a Binary Search

First key accessed
Second key accessed
Third key accessed
Fourth key accessed
 
[2]
A file has 32,767 records in it. The maximum number of keys accessed in a binary search is 15

What would be the maximum number of keys accessed if the file had 65,535 records?

What would be the maximum number of keys accessed for the file of 65,535 records if the computer used a linear search?
 

   Back