这里强烈推荐一个博主写的二分搜索总结:http://www.cnblogs.com/grandyang/p/6854825.html
参考链接:
https://leetcode.com/problems/find-first-and-last-position-of-element-in-sorted-array/solution/
LeetCode 34. Find First and Last Position of Element in Sorted Array
原文:https://www.cnblogs.com/dapeng-bupt/p/9903437.html