Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

a.) What is the largest number of key comparisons made by binary search in searc

ID: 1888279 • Letter: A

Question

a.) What is the largest number of key comparisons made by binary search in searching for a key in the following array?

1 3 5 7 9 11 13

b.) Find the average number of key comparisons made by binary search in a successful search in this particular array. Find out how many times it takes for each key 1,3,5,7,9,11,13 and take the average. (Assume that each key is searched for with the same probability.)
c.) Find the average number of key comparisons made by binary search in an unsuccessful search in this array. Don't use any formula but find out how many key comparisons for 0,2,4,6,8,10,12,14 and take the average.

Explanation / Answer

A) Maximum number of key comparison = 3