Recursive Binary Search

Medium

📝 Description

Implement binary search using recursion

Input Format

Sorted array and target value

Output Format

Index of target or -1

Constraints

Array must be sorted

🔍 Sample Input

1 3 5 7 9
5
            

✅ Sample Output

2
            

Code Editor

Please login to run and submit code.

Shortcuts: Ctrl+Enter to submit, Ctrl+Shift+R to run