Update binary_search_recur.py

This commit is contained in:
Yudong Jin 2024-05-17 18:43:53 +08:00 committed by GitHub
parent b9d3cb1e2c
commit 76ed25e7c2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -11,7 +11,7 @@ def dfs(nums: list[int], target: int, i: int, j: int) -> int:
if i > j:
return -1
# Calculate midpoint index m
m = i + (j - i) // 2
m = (i + j) // 2
if nums[m] < target:
# Recursive subproblem f(m+1, j)
return dfs(nums, target, m + 1, j)