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/66f5190d53b15_76466f5190ced93a.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 LEFTE MIDDLE+ 1; } //end while return index; }//end function Based on the given function, fill in the blanks with appropriate values when the function is executed. LEFT = MIDDLE = RIGHT = array[LEFT] = search_key = 63 [0] [1] [2] [3] [4] 10 32 54 60 63 LEFT = 3 MIDDLE = 3 RIGHT = 4 array[LEFT] = 60 10 32 54 60 63 LEFT = MIDDLE = RIGHT = array[LEFT] = 63 return = search_key = 63 [O] [2] [3] [4] [1] 32 10 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
