Suppose the inventory is unordered (!) and a sequential search is done to locate a specific artifact. Given that the search is executed on a computer that can do 12,000 comparisons per second, about how much time on the average would the search require? Assuming the inventory is sorted, about how much time would a binary search require?

Respuesta :

Answer:

The computer can do 12000 searches per second. Suppose there are 60000 inventory items. And we need to search one item from it in a sequential manner. The computer can do 12000 searches in one second. Hence it can search in a list of 60000 inventory in 5 seconds, as 12000 x 5 =60000 searches, in the worst case. And if the item is below 12000 on the list, it will take less than 1 second(1/12000 sec in best case), and so on.

And if we assume that the list is sorted, and perform a binary search. then in the worst case, the number of searches required in the worst case will be 60000/2= 30000. And the time required will be 30000/12000= 5/2=2.5 seconds, and (1/24000) seconds in the best case. Its 1/24000 as its binary search.

Explanation:

Please check the answer section.