經(jīng)驗(yàn)分享:
排序算法?https://blog.csdn.net/meibenxiang/article/details/92796909
刷題推薦:56、147、220票顾、 252
堆 最大堆,最小堆問題?
刷題推薦:215围俘、253鼠次、347肩袍、 624芥丧、703
分治法?https://zhuanlan.zhihu.com/p/72734354?http://www.reibang.com/p/6022bcdd6b62
刷題推薦:4、23蛾找、53、215赵誓、 240腋粥、327
回溯法?https://zhuanlan.zhihu.com/p/28340833?https://zhuanlan.zhihu.com/p/54144349
刷題推薦:10晦雨、17、22隘冲、39闹瞧、 46(經(jīng)典回溯)、 1239
貪心算法 https://zhuanlan.zhihu.com/p/25769975 http://www.reibang.com/p/fede80bad3f1?
刷題推薦:253展辞、406奥邮、621
動(dòng)態(tài)規(guī)劃?https://blog.csdn.net/qq_16664581/article/details/89598243(經(jīng)典求解套路, 看官方題解)
刷題推薦:?5罗珍、10洽腺、300、647
BFS:
1.?二叉樹的最小深度?https://leetcode-cn.com/problems/minimum-depth-of-binary-tree/
2.?打開轉(zhuǎn)盤鎖https://leetcode-cn.com/problems/open-the-lock/
3.腐爛的橘子?https://leetcode-cn.com/problems/rotting-oranges/
4.鑰匙和?房間?https://leetcode-cn.com/problems/keys-and-rooms/
單調(diào)棧:
1.?下一個(gè)更大元素?I?https://leetcode-cn.com/problems/next-greater-element-i/?(比當(dāng)前元素更大的下一個(gè)元素)
2.?下一個(gè)更大元素?II?https://leetcode-cn.com/problems/next-greater-element-ii/?(比當(dāng)前元素更大的下一個(gè)元素)
3.?股票價(jià)格跨度?https://leetcode-cn.com/problems/online-stock-span/?(比當(dāng)前元素更大的前一個(gè)元素)
4.?柱狀圖中最大的矩形https://leetcode-cn.com/problems/largest-rectangle-in-histogram/?(比當(dāng)前元素更小的下一個(gè)元素)
深度優(yōu)先搜索:
1.?員工的重要性?https://leetcode-cn.com/problems/employee-importance(記憶化)
2.?二叉樹的所有路徑?https://leetcode-cn.com/problems/binary-tree-paths(路徑)
3.?水壺問題?https://leetcode-cn.com/problems/water-and-jug-problem(狀態(tài)壓縮)
4.?課程表?II?https://leetcode-cn.com/problems/course-schedule-ii(拓?fù)渑判颍?/p>
5.?矩陣中的路徑?https://leetcode-cn.com/problems/ju-zhen-zhong-de-lu-jing-lcof(剪枝)
前綴和:
1.將數(shù)組分成三個(gè)子數(shù)組的方案數(shù)?https://leetcode-cn.com/problems/ways-to-split-array-into-three-subarrays/
2.和可被?K?整除的子數(shù)組https://leetcode-cn.com/problems/subarray-sums-divisible-by-k/
3.統(tǒng)計(jì)「優(yōu)美子數(shù)組」?https://leetcode-cn.com/problems/count-number-of-nice-subarrays/
并查集:
按字典序排列最小的等效字符串?https://leetcode-cn.com/problems/lexicographically-smallest-equivalent-string/
最低成本聯(lián)通所有城市?https://leetcode-cn.com/problems/connecting-cities-with-minimum-cost/
得分最高的路徑?https://leetcode-cn.com/problems/path-with-maximum-minimum-value/
雙指針:
重排鏈表:https://leetcode-cn.com/problems/reorder-list/
三數(shù)之和:https://leetcode-cn.com/problems/3sum/
有效三角形的個(gè)數(shù):https://leetcode-cn.com/problems/valid-triangle-number/
滑動(dòng)窗口
https://leetcode-cn.com/problems/longest-substring-without-repeating-characters/
https://leetcode-cn.com/problems/find-all-anagrams-in-a-string/
https://leetcode-cn.com/problems/permutation-in-string/
困難:https://leetcode-cn.com/problems/minimum-window-substring/