Skip to content

Commit

Permalink
Update binary_search_recur.py
Browse files Browse the repository at this point in the history
  • Loading branch information
krahets authored May 17, 2024
1 parent b9d3cb1 commit 76ed25e
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 76ed25e

Please sign in to comment.