From 75ffa5180eb8deda585fc73d55de985f1b37f661 Mon Sep 17 00:00:00 2001 From: Slone <50995948+Slone123c@users.noreply.github.com> Date: Mon, 5 Dec 2022 19:14:50 +0800 Subject: [PATCH] Update binary_search.md Edited number out of bound topic --- docs/chapter_searching/binary_search.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/docs/chapter_searching/binary_search.md b/docs/chapter_searching/binary_search.md index 04dbba8a0..0a407ff91 100644 --- a/docs/chapter_searching/binary_search.md +++ b/docs/chapter_searching/binary_search.md @@ -328,7 +328,10 @@ $$ === "Go" ```go title="" - + // (i + j) 有可能超出 int 的取值范围 + m := (i + j) / 2 + // 更换为此写法则不会越界 + m := i + (j - i) / 2 ``` === "JavaScript"