diff --git a/notes/算法.md b/notes/算法.md index 488beede..2ddd1f1b 100644 --- a/notes/算法.md +++ b/notes/算法.md @@ -105,8 +105,8 @@ public class ThreeSumFast { while (l <= h) { int m = l + (h - l) / 2; if (target == nums[m]) return m; - else if (target > nums[m]) h = m - 1; - else l = m + 1; + else if (target > nums[m]) l = m + 1; + else h = m - 1; } return -1; }