Question: 4. Suppose you are given the following array x = [1, 6, 7, 9, 16, 20 ] And key = 20. Search for key within
4. Suppose you are given the following array x = [1, 6, 7, 9, 16, 20 ] And key = 20. Search for key within x using binary search algorithm. For each round show the values of low, high, mid and comparison until the algorithm either finds the key in the array or does not. First round has been done for you. Round 1: low = 0 high = 5 mid = (0+5)/2 = 5/2 = 2 comparison = 20 > 7 Round 2
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
