Challenge: Recursion
Test your knowledge of recursion by solving this exercise.
We'll cover the following...
Let's practice what we've learned so far.
Logic building
In order to solve part (a) of the problem, we’ll first begin by analyzing the algorithm below. After that, we’ll move on to coding implementation.
(a) Algorithm to compute :
- Initialize two pointers, left and right, to the beginning and end of the array, respectively ().
- While :
- Calculate the middle index: