We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent eb1e40e commit 1e86a66Copy full SHA for 1e86a66
数组/35. Search Insert Position/README.md
@@ -0,0 +1,4 @@
1
+这是一道二分法的典型习题,题目要求在一个有序数组中查找某个数,如果找不到,就返回它应该在的位置索引
2
+
3
+刚开始用了 indexOf() 如果找到了就返回索引,找不到就添加这个数进数组在排序,最后在返回 indexOf() 的查找结果,
4
+后来发现有些测试用例通不过,看了下讨论区,才发现二分查找这个方法。这种真的要多练思路才会更广阔。
0 commit comments