What is the largest number of key comparisons made by binary search in searching
ID: 3647516 • Letter: W
Question
Explanation / Answer
(a) largest number of comparisons will be : 3 its a general formula . i.e, largest number of key comparisons will be lower bound of lg(n) + 1 where n is the total number of elements. (b) comparison made for searching 1 = 3 comparison made for searching 3 = 2 comparison made for searching 5 = 3 comparison made for searching 7 = 1 comparison made for searching 9 = 3 comparison made for searching 11 = 2 comparison made for searching 13 = 3 so total = 17 so, average = 17 /7 = 2.43 (c) for an unsuccessful search u have to do the largest number of comparisons for each search. so each time u have to do 3 comparisons average = 3
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.