Junior — Senior
Recursive implementation of binary search
livecode
Task condition
It is necessary to convert the current iterative implementation of binary search into a recursive one. The function receives a sorted array and a target value, and should return the position of the found element or -1 if the element is absent.
sorted_arr = [1, 5, 7, 10, 20, 100]
def binary_search_recursive(sorted_arr, key):
...