auto commit

This commit is contained in:
CyC2018
2019-03-08 21:56:42 +08:00
parent ce05657a6c
commit 722b67a3c7
19 changed files with 67 additions and 56 deletions

View File

@ -112,7 +112,7 @@ Output: 2
Explanation: The square root of 8 is 2.82842..., and since we want to return an integer, the decimal part will be truncated.
```
一个数 x 的开方 sqrt 一定在 0 ~ x 之间并且满足 sqrt == x / sqrt可以利用二分查找在 0 ~ x 之间查找 sqrt
一个数 x 的开方 sqrt 一定在 0 \~ x 之间并且满足 sqrt == x / sqrt可以利用二分查找在 0 \~ x 之间查找 sqrt
对于 x = 8它的开方是 2.82842...最后应该返回 2 而不是 3在循环条件为 l <= h 并且循环退出时h 总是比 l 1也就是说 h = 2l = 3因此最后的返回值应该为 h 而不是 l