- 对于有序数组的搜索问题,使用二分查找法,
- 二分查找寻找数是否在数组当中
- 二分查找边解决界搜索问题,例如剑指 Offer 53 - I. 在排序数组中查找数字 I
- 查找数据缺失问题,如0~n-1中缺失的数字
- 对于先出现的数据后使用的操作,考虑使用栈
- 对于先出现先使用的操作,考虑使用队列
- 使用队列做二叉树的按层遍历/广度优先搜索,如剑指 Offer 32 - II. 从上到下打印二叉树 II.
- 找出第一个满足某个条件的元素,如剑指 Offer 50. 第一个只出现一次的字符。
Leetcode刷题技巧
猜你喜欢
转载自blog.csdn.net/weixin_43490422/article/details/126805722
今日推荐
周排行