Skip to content

Commit 1e86a66

Browse files
authored
Create README.md
1 parent eb1e40e commit 1e86a66

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
这是一道二分法的典型习题,题目要求在一个有序数组中查找某个数,如果找不到,就返回它应该在的位置索引
2+
3+
刚开始用了 indexOf() 如果找到了就返回索引,找不到就添加这个数进数组在排序,最后在返回 indexOf() 的查找结果,
4+
后来发现有些测试用例通不过,看了下讨论区,才发现二分查找这个方法。这种真的要多练思路才会更广阔。

0 commit comments

Comments
 (0)