35. Search Insert Position

题目: 解答: 使用二分查找,注意确定插入位置的方法。 下面代码注意注释的位置,为何可以这样优化掉。 代码: class Solution { public: int searchInsert(vector<int>& nums, int begin, int end, int target){ if(begin >= end) return begin;
相关文章
相关标签/搜索