Solved

The Following Code Is an Example of a __________ Recursive \quad

Question 13

Multiple Choice

The following code is an example of a __________ recursive algorithm. int myRecursion(int array[], int first, int last, int val)
{
int num;
if (first > last)
\quad return -1;
num = (first + last) /2;
if (array[num] == val)
\quad return num;
if (array[num] < val)
\quad return myRecursion(array, num + 1, last, val) ;
else
\quad return myRecursion(array, first, num - 1, val) ;
}


A) Towers of Hanoi
B) QuickSort
C) binary search
D) doubly linked list
E) None of these

Correct Answer:

verifed

Verified

Unlock this answer now
Get Access to more Verified Answers free of charge

Related Questions