Question: hello sir/mam, please ans the gaps a) Given a search function as below. [5 marks] int search(int search_key, int array[ ] int array size) _size)

![as below. [5 marks] int search(int search_key, int array[ ] int array](https://dsd5zvtm8ll6.cloudfront.net/si.experts.images/questions/2024/09/66f39589b484e_56166f39589506fc.jpg)

hello sir/mam,
please ans the gaps
a) Given a search function as below. [5 marks] int search(int search_key, int array[ ] int array size) _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 value when the function is executed. MIDDLE = array[LEFT] = LEFT = RIGHT = search_key = 12 [o] [1] [2] [3] [4] 2 3 5 9 12 LEFT = MIDDLE = RIGHT = 4 array[LEFT] = 9 search_key = 12 [o] [1] [2] [3] [4] 2 3 5 9 12 LEFT = 4 MIDDLE = RIGHT = 4 array(LEFT) = 12 return = search_key = 12 [0] [1] [2] [3] 3 [4] 2 3 5 9 12 d) What is the time complexity (Big O notation) the above function? O [2 marks]
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
