Assume that we are using binary search algorithm to sort the following elements in the array 12, 15, 16,20, 27, 31. What will be the entire simulation processes if you are searching for 16 and then for 27?
SUBMIT Detailed and correct answer only. Thank you!!
Algorithm:
int mid = (left+right)/2;
merge_sort(a, left, mid, temp);
merge_sort(a, mid+1, right, temp);
merge_array(a, left, mid,right, temp);