# algorithm **Repository Path**: qiaorunqiang/algorithm ## Basic Information - **Project Name**: algorithm - **Description**: 算法学习 - **Primary Language**: JavaScript - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2022-04-22 - **Last Updated**: 2023-02-23 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # 算法学习 #### 训练营介绍 20节课*2小时 = 40小时讲解 10大类,35小类知识点 每个知识点5~7道例题 #### 学习时间 2022/10/19~2023/4/18 (24周,半年)125个工作日 * 1小时 = 125小时 #### 定位 做中等题,难题有一定的思考方向。 记住课上教的内容按要求完成作业(5选2) 每节课2h教学+0.5小时回顾+3.5小时刷题,一共120h #### 听课方式 (以一节课的一小节为单位,小节见计划按排) 1.课前预习(浏览PPT,标注自己完全不懂的地方,每个知识点选一道例题,看题意,大致想一想) 2.课上听讲(跟进老师的大的思考方向,不要拘泥细节的证明,可以之后再回放,承认算法和数据结构的复杂行,课上只能听懂60%~70%是正常的) 3.独立思考,自己实现课上例题(如果有卡的地方,通过回顾补全) 4.课后回顾(不要1.0倍数播放,只需要回放重点,不理解的地方,或者1.5~2倍回放) 5.补全课上例题 6.完成课后作业(5选2)坚持五步解题 #### 刷题方法(分类三刷) >初学建议分类刷 -> 后期建议综合刷题 1.一刷:每个小类别的代表性题目,各刷几道(此时如果需要看题解很正常) 2.二刷:复习代表性题目(小类别合成大类别,刷该分类更多的题目,举一反三,在尽量少的提示下完成) 3.三刷:综合性题目,尽量独立实现+测试 #### 解题方法(五步解题) a.三等分时间(1/3思考,1/3看题解,1/3自己实现) 1.理解题目 (想一想更多的例子和测试数据,提炼题目中的关键信息,变化信息) 2.部分实现(先尝试一个朴素解法比如说搜索) 3.看提示解题(题解标题,时间复杂度,关键描述) 看提示 != 看题解 4.独立解答 5.写题解 (遇到坑了,或者觉得题目比较典型,写题解及解题思路) #### 算法学习误区 1.对待题解的两个极端(看题解刷题/坚决不看题解) 2.leetCode 每题只做一遍,或者leetCode综合刷题 3.面对一道题,拿学过的算法挨个求解(坚持五步刷题) 4.使劲做题,记忆每道题的代码(可以记忆模型,模版) #### 课时学习计划安排(每周一节课) --- ##### 第一周 数组、链表 (10) 2022/10/19~2022/10/26 ###### 1.数组原理讲解、实战应用(3) - ✅ [88. 合并两个有序数组](https://leetcode.cn/problems/merge-sorted-array/) - ✅ [26. 删除有序数组中的重复项](https://leetcode.cn/problems/remove-duplicates-from-sorted-array/) - ✅ [283. 移动零](https://leetcode.cn/problems/move-zeroes/) ###### 2.设计变长数组 ###### 3.数组原理讲解、实战应用(5) - ✅ [206. 反转链表](https://leetcode.cn/problems/reverse-linked-list/) - ✅ [25. K 个一组翻转链表](https://leetcode.cn/problems/reverse-nodes-in-k-group/) - [邻值查找](https://www.acwing.com/problem/content/description/138/) - ✅ [141. 环形链表](https://leetcode.cn/problems/linked-list-cycle/) - [142. 环形链表 II](https://leetcode.cn/problems/linked-list-cycle-ii/) ###### 4.Homework (2) - [21. 合并两个有序链表](https://leetcode.cn/problems/merge-two-sorted-lists/) - [66. 加一](https://leetcode.cn/problems/plus-one/) --- ##### 第二周 栈、队列 (10) (2022/10/26~2022/11/01) ###### 1.栈、队列及其常见变形、实战应用(3) - ✅ [20. 有效的括号](https://leetcode.cn/problems/valid-parentheses/) - ✅ [155. 最小栈](https://leetcode.cn/problems/min-stack/) ###### 2.表达式求值系列问题 (2) - ✅ [150. 逆波兰表达式求值(后缀表达式求值)](https://leetcode.cn/problems/evaluate-reverse-polish-notation/) - ✅ [227. 基本计算器 II](https://leetcode.cn/problems/basic-calculator-ii/) - [224. 基本计算器(中缀表达式求值)](https://leetcode.cn/problems/basic-calculator/) ###### 3.单调栈与单调队列 (3) - ✅ **[84. 柱状图中最大的矩形(单调栈)](https://leetcode.cn/problems/largest-rectangle-in-histogram/)模版题** - ✅ **[239. 滑动窗口最大值(单调队列)](https://leetcode.cn/problems/sliding-window-maximum/) 模版题** - ✅ [42. 接雨水](https://leetcode.cn/problems/trapping-rain-water/) ###### 4.Homework (2) - [641. 设计循环双端队列](https://leetcode.cn/problems/design-circular-deque/) - [85. 最大矩形](https://leetcode.cn/problems/maximal-rectangle/) ##### 第三周 哈希表、集合、映射 (8) (2022/11/02~2022/11/08) ###### 1.哈希表的原理及实现 ###### 2.无序集合、映射的实现与应用(4) - ✅ [1. 两数之和](https://leetcode.cn/problems/two-sum/description/) - [874. 模拟行走机器人](https://leetcode.cn/problems/walking-robot-simulation/) - ✅ [49. 字母异位词分组](https://leetcode.cn/problems/group-anagrams/) - [30. 串联所有单词的子串](https://leetcode.cn/problems/substring-with-concatenation-of-all-words/) ###### 3.实现一个URL(1) - **✅ [146. LRU 缓存](https://leetcode.cn/problems/lru-cache/) 模版题** ###### 4.Homework (3) - [811. 子域名访问计数](https://leetcode.cn/problems/subdomain-visit-count/) - [697. 数组的度](https://leetcode.cn/problems/degree-of-an-array/) - [1074. 元素和为目标值的子矩阵数量](https://leetcode.cn/problems/number-of-submatrices-that-sum-to-target/) ##### 第四周 前缀和、差分、双指针扫描 (9) (2022/11/09~2022/11/15) ###### 1.前缀和、差分思想(4) - [1248. 统计「优美子数组」](https://leetcode.cn/problems/count-number-of-nice-subarrays/) - **[304. 二维区域和检索 - 矩阵不可变](https://leetcode.cn/problems/range-sum-query-2d-immutable/) 模版题** - **[1109. 航班预订统计](https://leetcode.cn/problems/corporate-flight-bookings/) 模版题** - [53. 最大子数组和](https://leetcode.cn/problems/maximum-subarray/) ###### 2.双指针扫描、滑动窗口(4) - ✅ [1. 两数之和](https://leetcode.cn/problems/two-sum/description/) - ✅ **[167. 两数之和 II - 输入有序数组](https://leetcode.cn/problems/two-sum-ii-input-array-is-sorted/) 模版题** - ✅ [15. 三数之和](https://leetcode.cn/problems/3sum/) - ✅ [11. 盛最多水的容器](https://leetcode.cn/problems/container-with-most-water/) ###### 3.Homework (1) - [560. 和为 K 的子数组](https://leetcode.cn/problems/subarray-sum-equals-k/) ##### 第五周 递归、分治 (11) (2022/11/16~2022/11/22) ###### 1.递归的本质与基本实现形式 ###### 2.递归题目实战(3) - **✅[78. 子集](https://leetcode.cn/problems/subsets/) 模版题** - **✅[77. 组合](https://leetcode.cn/problems/combinations/) 模版题** - **✅[46. 全排列](https://leetcode.cn/problems/permutations/) 模版题** ###### 3.分治:子问题的划分与合并 (4) - ✅[226. 翻转二叉树](https://leetcode.cn/problems/invert-binary-tree/description/) - ✅[98. 验证二叉搜索树](https://leetcode.cn/problems/validate-binary-search-tree/) - ✅[104. 二叉树的最大深度](https://leetcode.cn/problems/maximum-depth-of-binary-tree/) - ✅[111. 二叉树的最小深度](https://leetcode.cn/problems/minimum-depth-of-binary-tree/) ###### 4.分治算法应用 (2) - [50. Pow(x, n)](https://leetcode.cn/problems/powx-n/) - ✅[22. 括号生成](https://leetcode.cn/problems/generate-parentheses/) ###### 3.Homework (2) - [23. 合并K个升序链表](https://leetcode.cn/problems/merge-k-sorted-lists/) - [47. 全排列 II](https://leetcode.cn/problems/permutations-ii/) ##### 第六周 树与图 (11) (2022/11/22~2022/11/28) ###### 1.树、二叉树、树的遍历、树的序列化(5) - [94. 二叉树的中序遍历](https://leetcode.cn/problems/binary-tree-inorder-traversal/) - [589. N 叉树的前序遍历](https://leetcode.cn/problems/n-ary-tree-preorder-traversal/description/) - [429. N 叉树的层序遍历](https://leetcode.cn/problems/n-ary-tree-level-order-traversal/) - [297. 二叉树的序列化与反序列化](https://leetcode.cn/problems/serialize-and-deserialize-binary-tree/) - [105. 从前序与中序遍历序列构造二叉树](https://leetcode.cn/problems/construct-binary-tree-from-preorder-and-inorder-traversal/) ###### 2.树的直径、最近公共祖先(1) - [236. 二叉树的最近公共祖先](https://leetcode.cn/problems/lowest-common-ancestor-of-a-binary-tree/) ###### 3.树的变形 ###### 4.图、图的遍历、拓扑排序 (3) - [207. 课程表](https://leetcode.cn/problems/course-schedule/) - [684. 冗余连接](https://leetcode.cn/problems/redundant-connection/description/) - [685. 冗余连接 II](https://leetcode.cn/problems/redundant-connection-ii/) ###### 3.Homework (2) - [106. 从中序与后序遍历序列构造二叉树](https://leetcode.cn/problems/construct-binary-tree-from-inorder-and-postorder-traversal/) - [210. 课程表 II](https://leetcode.cn/problems/course-schedule-ii/)