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)

 hello sir/mam, please ans the gaps a) Given a search functionas below. [5 marks] int search(int search_key, int array[ ] int arraysize) _size) {int p; int index = -1; //-1 means record not

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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!