Recursive Binary Search

Write binary_search_recursive(sorted_list, target, low, high) that searches a sorted list recursively, returning the index of target if found, or -1 if not.

Read n (the list length), then the n sorted values on one line, then the target value. Print the result of calling binary_search_recursive(sorted_list, target, 0, n - 1).

Example: list 3 7 12 19 25 34 41, target 25 → found at index 4.

main.py
Loading editor…

Console

Run your code to see output here.