# 第一章 - 算法专题

以下是一些我总结的类型题目，提前搞懂这些东西对之后的做题很有帮助，强烈建议先掌握。另外我的 91 天学算法也对专题进行了更细粒度的整理，具体参见[91 天学算法](https://leetcode-solution-leetcode-pp.gitbook.io/leetcode-solution/91)

首先基础的数据结构大家是必须掌握的，其次就是暴力法。暴力法也是算法，只不过我们追求的肯定是性能更好的算法。因此了解暴力法的算法瓶颈以及各种数据结构的特点就很重要， 这样你就可以根据这些知识去一步步逼近最优解。

再之后就是必须掌握的算法。比如搜索算法是必须掌握的，搜索算法的范围很广，但是核心就是搜索的，不同的算法在于搜索的方式不同，典型的就是 BFS 和 DFS，当然二分法本质上也是一种搜索算法。

还有就是暴力优化法也是必须掌握的，和搜索一样，范围很广。 有剪枝， 空间换时间等。 其中空间换时间又有很多，比如哈希表， 前缀树等等。

围绕这个思想去学习， 就不会差太多，其他我就不多说，大家慢慢体会。

* [数据结构总览](https://leetcode-solution-leetcode-pp.gitbook.io/leetcode-solution/thinkings/basic-data-structure)
* [链表专题](https://leetcode-solution-leetcode-pp.gitbook.io/leetcode-solution/thinkings/linked-list)
* [树专题](https://leetcode-solution-leetcode-pp.gitbook.io/leetcode-solution/thinkings/tree)
* [堆专题（上）](https://leetcode-solution-leetcode-pp.gitbook.io/leetcode-solution/thinkings/heap)
* [堆专题（下）](https://leetcode-solution-leetcode-pp.gitbook.io/leetcode-solution/thinkings/heap-2)
* [二分专题（上）](https://leetcode-solution-leetcode-pp.gitbook.io/leetcode-solution/thinkings/binary-search-1)
* [二分专题（下）](https://leetcode-solution-leetcode-pp.gitbook.io/leetcode-solution/thinkings/binary-search-2)
* [二叉树的遍历](https://leetcode-solution-leetcode-pp.gitbook.io/leetcode-solution/thinkings/binary-tree-traversal)
* [动态规划](https://leetcode-solution-leetcode-pp.gitbook.io/leetcode-solution/thinkings/dynamic-programming)
* [回溯](https://leetcode-solution-leetcode-pp.gitbook.io/leetcode-solution/thinkings/backtrack)
* [哈夫曼编码和游程编码](https://leetcode-solution-leetcode-pp.gitbook.io/leetcode-solution/thinkings/run-length-encode-and-huffman-encode)
* [布隆过滤器](https://leetcode-solution-leetcode-pp.gitbook.io/leetcode-solution/thinkings/bloom-filter)🖊
* [前缀树](https://leetcode-solution-leetcode-pp.gitbook.io/leetcode-solution/thinkings/trie)🖊
* [《日程安排》专题](https://lucifer.ren/blog/2020/02/03/leetcode-%E6%88%91%E7%9A%84%E6%97%A5%E7%A8%8B%E5%AE%89%E6%8E%92%E8%A1%A8%E7%B3%BB%E5%88%97/)
* [《构造二叉树》专题](https://lucifer.ren/blog/2020/02/08/%E6%9E%84%E9%80%A0%E4%BA%8C%E5%8F%89%E6%A0%91%E4%B8%93%E9%A2%98/)
* [滑动窗口（思路 + 模板）](https://leetcode-solution-leetcode-pp.gitbook.io/leetcode-solution/thinkings/slide-window)
* [位运算](https://leetcode-solution-leetcode-pp.gitbook.io/leetcode-solution/thinkings/bit)
* [小岛问题](https://leetcode-solution-leetcode-pp.gitbook.io/leetcode-solution/thinkings/island)🖊
* [最大公约数](https://leetcode-solution-leetcode-pp.gitbook.io/leetcode-solution/thinkings/gcd)
* [并查集](https://leetcode-solution-leetcode-pp.gitbook.io/leetcode-solution/thinkings/union-find)
* [平衡二叉树专题](https://leetcode-solution-leetcode-pp.gitbook.io/leetcode-solution/thinkings/balanced-tree)
* [蓄水池抽样](https://leetcode-solution-leetcode-pp.gitbook.io/leetcode-solution/thinkings/reservoid-sampling)
* [单调栈](https://leetcode-solution-leetcode-pp.gitbook.io/leetcode-solution/thinkings/monotone-stack)
