Quiz: Recursion

Let’s attempt the quiz to test what we’ve learned so far about recusion.


Given an array of integers in increasing order, find if avalue is present in the array using recursion.


An integer array and an integer number.


Return true if integer found. Otherwise, return false.

Sample input

array = { 1, 3, 4, 6, 8, 10 }
num = 3

Sample output


This will be done in O(log(n))O(log(n)).

Let’s look at the illustration below to better understand the problem.

Level up your interview prep. Join Educative to access 70+ hands-on prep courses.