Question- In C++ write a recursive and iterative versions of binary search and compare their run times using the array a[i]=i, i=0,..., n-1 and the given test method:
for(i=0; i
if(a[i] != a[binary_search(... a[i] ...)])
cout << "ERROR\n";
You need to implement this in C++ language. You need to provide the answer as soon as possible.