版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/zem_nezer/article/details/85061591
Use the most understandable method, in binary search, we can know that at least one part is sort in order. Base on that, we just need to care about the part is sorted, if current target is in that part, narrow the index within such range, otherwise go to the other part.
At first I cannot understand such concept, so I just compare the neighbor of the middle point. It is a good lesson for me to learn about binary search.