mirror of
https://github.com/krahets/hello-algo.git
synced 2026-07-12 15:36:05 +00:00
build
This commit is contained in:
@@ -83,7 +83,7 @@ In the implementation code, we declare a recursive function `dfs()` to solve the
|
||||
return -1;
|
||||
}
|
||||
// Calculate midpoint index m
|
||||
int m = (i + j) / 2;
|
||||
int m = i + (j - i) / 2;
|
||||
if (nums[m] < target) {
|
||||
// Recursive subproblem f(m+1, j)
|
||||
return dfs(nums, target, m + 1, j);
|
||||
@@ -114,7 +114,7 @@ In the implementation code, we declare a recursive function `dfs()` to solve the
|
||||
return -1;
|
||||
}
|
||||
// Calculate midpoint index m
|
||||
int m = (i + j) / 2;
|
||||
int m = i + (j - i) / 2;
|
||||
if (nums[m] < target) {
|
||||
// Recursive subproblem f(m+1, j)
|
||||
return dfs(nums, target, m + 1, j);
|
||||
|
||||
Reference in New Issue
Block a user