Menu

(Solved) : 3 Consider Average Case Analysis Binary Search Let 1 Given Array Sorted Distinct Numbers L Q37158404 . . .

3) Consider the average case analysis for binary search. Let A[1..] be the given array of sorted distinct numbers and let n 2

3) Consider the average case analysis for binary search. Let A[1..] be the given array of sorted distinct numbers and let n 2k for some integer k. Consider a successful search (i.e., the number you want to search exists in the array A and there are only n possible cases for input). (a) [2%] How many case(s) requiring only one comparison to locate the given number? How many cases requiring exactly two comparisons to locate the given number? number (1 S isk). successful search in binary search assuming that all n cases are equally likely (b) [396] How many case(s) requiring exactly i comparisons to locate the given (c) [10%] Hence, or otherwise, compute the average case complexity for Show transcribed image text 3) Consider the average case analysis for binary search. Let A[1..] be the given array of sorted distinct numbers and let n 2k for some integer k. Consider a successful search (i.e., the number you want to search exists in the array A and there are only n possible cases for input). (a) [2%] How many case(s) requiring only one comparison to locate the given number? How many cases requiring exactly two comparisons to locate the given number? number (1 S isk). successful search in binary search assuming that all n cases are equally likely (b) [396] How many case(s) requiring exactly i comparisons to locate the given (c) [10%] Hence, or otherwise, compute the average case complexity for

Expert Answer


Answer to 3) Consider the average case analysis for binary search. Let A[1..] be the given array of sorted distinct numbers and le…

OR