摘要: 最近刷leetcode,做了挺多道二分查找的题目,感觉二分查找并没有想象中的简单,一些变形题还是有一定难度的,所以这里做一个总结,方便自己以后复习。 首先,二分查找一般有两种写法 左闭右闭写法 int search(vector<int> &nums, int target){ int left = 阅读全文
posted @ 2021-03-13 15:49 nullxjx 阅读(109) 评论(0) 推荐(0) 编辑