Question: a) Given a search function as below. int Search(int search_key, int array[ ], int array_size) { int p; int index = -1; //-1 means record

![array[ ], int array_size) { int p; int index = -1; //-1](https://dsd5zvtm8ll6.cloudfront.net/si.experts.images/questions/2024/09/66fa500f53e4b_52666fa500ee68f2.jpg)
a) Given a search function as below. int Search(int search_key, int array[ ], int array_size) { int p; int index = -1; //-1 means record not found for (p = 0; p search_key) RIGHT= MIDDLE- 1; .. . else LEFT= MIDDLE+ 1; } //end while return index; }//end function Based on the given function, fill in the blanks with appropriate values when the function is LEFT = MIDDLE = RIGHT = array[LEFT] = search_key = 63 (0) [1] [2] [3] 10 32 54 60 63 LEFT = 3 MIDDLE = 3 RIGHT = 4 array[LEFT] = 60 search_key = 63 [0] [1] [2] [3] 10 32 54 60 63 LEFT = MIDDLE = RIGHT = array[LEFT] = 63 return = search_key = 63 [0] [1] [2] [3] [4] 10 32 54 60 63 d) What is the time complexity (Big O notation) of the above function? O
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
