In: Advanced Math
int BBOX(int n, int k)
if (n <= 0) return 0;
else if (A[n] < k) return (1+ 2*BBOX(n-1,k+1));
else return BBOX(n-1,k-2);
Find BBOX(8, 5)
If you find my answer useful please put thumbs up. Thank you.
Explaination of the function BBOX(int n, int k):
The working of the function call BBOX(8,5) is shown below