Question: Question 37 2 pts What should be returned where it shows XXX in the following code? #include using namespace std; int BinarySearch(int list[], int listsize,

 Question 37 2 pts What should be returned where it shows

Question 37 2 pts What should be returned where it shows XXX in the following code? #include using namespace std; int BinarySearch(int list[], int listsize, int key) { int mid; int low; int high; low = @ high = listSize - 1; while (high >= low) { mid = (high + low) / 2; if (list[mid] key) { high = mid - 1; } else { return XXX; } } return -1; } int main() { int list[] = { 2, 4, 7, 10, 11, 32, 45, 87 }; const int LIST_SIZE = 8; int i; int key; int key Index; cout > key; keyIndex = BinarySearch(list, LIST_SIZE, key); if (keyIndex = -1) { cout

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!