摘要: 二分查找 1.查找第一个大于等于target的值 给定一个排序数组和一个目标值,在数组中找到目标值,并返回其索引。 如果目标值不存在于数组中,返回它将会被按顺序插入的位置。 int searchInsert(vector<int>& nums, int target) { int l=0,r=num 阅读全文
posted @ 2021-05-07 21:06 Barrymeng 阅读(73) 评论(0) 推荐(0)