fynn90 / algorithm004-04

Algorithm004-04

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

算法训练营

预习周

第一课

数据接口脑图

算法脑图

第二课

自顶向下的编程方式-Clean Code: Book Review

如何理解时间复杂度的表示方法

Master Theorem

主定理

第一周

第三课 | 数组、链表、跳表

1.数组、链表、跳表的基本实现和特性

Java 源码分析(ArrayList)

Linked List 的标准实现代码

[Linked List 示例代码](http://www.cs.cmu.edu/~adamchik/15-121/lectures/Linked Lists/code/LinkedList.java)

Java 源码分析(LinkedList)

LRU Cache - Linked list: LRU 缓存机制

Redis - Skip List:跳跃表为啥 Redis 使用跳表(Skip List)而不是使用 Red-Black?

2. 实战题目解析:移动零

3. 实战题目解析:盛水最多的容器、爬楼梯

Array 实战题目

https://leetcode-cn.com/problems/container-with-most-water/

https://leetcode-cn.com/problems/move-zeroes/

https://leetcode.com/problems/climbing-stairs/

https://leetcode-cn.com/problems/3sum/(高频老题)

4. 实战题目解析:3数之和、环形链表

两数之和题目: https://leetcode-cn.com/problems/two-sum/

Linked List 实战题目

https://leetcode.com/problems/reverse-linked-list/

https://leetcode.com/problems/swap-nodes-in-pairs

https://leetcode.com/problems/linked-list-cycle

https://leetcode.com/problems/linked-list-cycle-ii

https://leetcode.com/problems/reverse-nodes-in-k-group/

课后作业

https://leetcode-cn.com/problems/remove-duplicates-from-sorted-array/

https://leetcode-cn.com/problems/rotate-array/

https://leetcode-cn.com/problems/merge-two-sorted-lists/

https://leetcode-cn.com/problems/merge-sorted-array/

https://leetcode-cn.com/problems/two-sum/

https://leetcode-cn.com/problems/move-zeroes/

https://leetcode-cn.com/problems/plus-one/

第四课 | 栈、队列、优先队列、双端队列

1. 栈和队列的实现与特性

参考链接

Java 的 PriorityQueue 文档

Java 的 Stack 源码

Java 的 Queue 源码

Python 的 heapq

高性能的 container 库

2. 实战题目解析:有效的括号、最小栈等问题

预习题目

https://leetcode-cn.com/problems/valid-parentheses/

https://leetcode-cn.com/problems/min-stack/

实战题目

https://leetcode-cn.com/problems/largest-rectangle-in-histogram

https://leetcode-cn.com/problems/sliding-window-maximum

课后作业

用 add first 或 add last 这套新的 API 改写 Deque 的代码

分析 Queue 和 Priority Queue 的源码

https://leetcode.com/problems/design-circular-deque

https://leetcode.com/problems/trapping-rain-water/

第二周

第五课 | 哈希表、映射、集合

1. 哈希表、映射、集合的实现与特性

Java Set 文档

Java Map 文档

2. 实战题目解析:有效的字母异位词等问题

实战题目 / 课后作业

https://leetcode-cn.com/problems/valid-anagram/description/

https://leetcode-cn.com/problems/group-anagrams/

https://leetcode-cn.com/problems/two-sum/description/

参考链接

养成收藏精选代码的习惯(示例)

第六课 | 树、二叉树、二叉搜索树

1.树、二叉树、二叉搜索树的实现和特性

参考链接

二叉搜索树 Demo

2. 实战题目解析:二叉树的中序遍历

参考链接

树的遍历 Demo

实战题目 / 课后作业

https://leetcode-cn.com/problems/binary-tree-inorder-traversal/

https://leetcode-cn.com/problems/binary-tree-preorder-traversal/

https://leetcode-cn.com/problems/n-ary-tree-postorder-traversal/

https://leetcode-cn.com/problems/n-ary-tree-preorder-traversal/

https://leetcode-cn.com/problems/n-ary-tree-level-order-traversal/

第七课 | 范型递归、树的递归

1. 递归的实现、特性以及思维要点

参考链接

递归代码模板

2. 实战题目解析:爬楼梯、括号生成等问题

实战题目

https://leetcode-cn.com/problems/climbing-stairs/

https://leetcode-cn.com/problems/generate-parentheses/

https://leetcode-cn.com/problems/invert-binary-tree/description/

https://leetcode-cn.com/problems/validate-binary-search-tree

https://leetcode-cn.com/problems/maximum-depth-of-binary-tree

https://leetcode-cn.com/problems/minimum-depth-of-binary-tree

https://leetcode-cn.com/problems/serialize-and-deserialize-binary-tree/

课后作业

https://leetcode-cn.com/problems/lowest-common-ancestor-of-a-binary-tree/

https://leetcode-cn.com/problems/construct-binary-tree-from-preorder-and-inorder-traversal

https://leetcode-cn.com/problems/combinations/

https://leetcode-cn.com/problems/permutations/

https://leetcode-cn.com/problems/permutations-ii/

第八课 | 分治、回朔

1. 分治、回溯的实现和特性

参考链接

分治代码模板

括号生成问题

2. 实战题目解析:Pow(x,n)、子集

预习题目

https://leetcode-cn.com/problems/powx-n/

https://leetcode-cn.com/problems/subsets/

参考链接

牛顿迭代法原理

牛顿迭代法代码

3. 实战题目解析:电话号码的字母组合、N皇后

实战题目

https://leetcode-cn.com/problems/majority-element/description/ (简单、但是高频)

https://leetcode-cn.com/problems/letter-combinations-of-a-phone-number/

https://leetcode-cn.com/problems/n-queens/

第三周

第九课 | 深度优先搜索 和 广度优先搜索

1. 深度优先搜索、广度优先搜索的实现和特性

参考链接

DFS 代码模板(递归写法、非递归写法)

BFS 代码模板

2. 实战题目解析:二叉树的层次遍历等问题

实战题目

https://leetcode-cn.com/problems/binary-tree-level-order-traversal/#/description

https://leetcode-cn.com/problems/minimum-genetic-mutation/#/description

https://leetcode-cn.com/problems/generate-parentheses/#/description

https://leetcode-cn.com/problems/find-largest-value-in-each-tree-row/#/description

课后作业

https://leetcode-cn.com/problems/word-ladder/description/

https://leetcode-cn.com/problems/word-ladder-ii/description/

https://leetcode-cn.com/problems/number-of-islands/

https://leetcode-cn.com/problems/minesweeper/description/

第十课 | 贪心算法

1. 贪心的实现、特性及实战题目解析

参考链接

coin change 题目

动态规划定义

课后作业

https://leetcode-cn.com/problems/lemonade-change/description/

https://leetcode-cn.com/problems/best-time-to-buy-and-sell-stock-ii/description/

https://leetcode-cn.com/problems/assign-cookies/description/

https://leetcode-cn.com/problems/walking-robot-simulation/description/

https://leetcode-cn.com/problems/jump-game/ https://leetcode-cn.com/problems/jump-game-ii/

第十一课 | 二分查找

1. 二分查找的实现、特性及实战题目解析

参考链接

二分查找代码模板

Fast InvSqrt() 扩展阅读

实战题目

https://leetcode-cn.com/problems/sqrtx/

https://leetcode-cn.com/problems/valid-perfect-square/

课后作业

https://leetcode-cn.com/problems/search-in-rotated-sorted-array/

https://leetcode-cn.com/problems/search-a-2d-matrix/

https://leetcode-cn.com/problems/find-minimum-in-rotated-sorted-array/

第五周

第十二课 | 动态规划

1. 动态规划的实现及关键点

参考链接

递归代码模板

分治代码模板

动态规划定义

3. DP例题解析:最长公共子序列

参考链接

不同路径题目

不同路径 2 题目

最长公共子序列题目

MIT 动态规划课程最短路径算法

4. 实战题目解析:三角形最小路径和

实战题目

https://leetcode-cn.com/problems/climbing-stairs/description/

https://leetcode-cn.com/problems/triangle/description/

https://leetcode.com/problems/triangle/discuss/38735/Python-easy-to-understand-solutions-(top-down-bottom-up)

https://leetcode-cn.com/problems/maximum-subarray/

https://leetcode-cn.com/problems/maximum-product-subarray/description/

https://leetcode-cn.com/problems/coin-change/description/

6. 实战题目解析:打家劫舍

实战题目

https://leetcode-cn.com/problems/house-robber/

https://leetcode-cn.com/problems/house-robber-ii/description/

https://leetcode-cn.com/problems/best-time-to-buy-and-sell-stock/#/description

https://leetcode-cn.com/problems/best-time-to-buy-and-sell-stock-ii/

https://leetcode-cn.com/problems/best-time-to-buy-and-sell-stock-iii/

https://leetcode-cn.com/problems/best-time-to-buy-and-sell-stock-with-cooldown/

https://leetcode-cn.com/problems/best-time-to-buy-and-sell-stock-iv/

https://leetcode-cn.com/problems/best-time-to-buy-and-sell-stock-with-transaction-fee/

https://leetcode-cn.com/problems/best-time-to-buy-and-sell-stock/solution/yi-ge-fang-fa-tuan-mie-6-dao-gu-piao-wen-ti-by-l-3/

高级 DP 实战题目

https://leetcode-cn.com/problems/perfect-squares/

https://leetcode-cn.com/problems/edit-distance/ ](https://leetcode-cn.com/problems/edit-distance/)(重点)

https://leetcode-cn.com/problems/jump-game/

https://leetcode-cn.com/problems/jump-game-ii/

https://leetcode-cn.com/problems/unique-paths/

https://leetcode-cn.com/problems/unique-paths-ii/

https://leetcode-cn.com/problems/unique-paths-iii/

https://leetcode-cn.com/problems/coin-change/

https://leetcode-cn.com/problems/coin-change-2/

课后作业

https://leetcode-cn.com/problems/longest-valid-parentheses/

https://leetcode-cn.com/problems/minimum-path-sum/

https://leetcode-cn.com/problems/edit-distance/

https://leetcode-cn.com/problems/decode-ways

https://leetcode-cn.com/problems/maximal-square/

https://leetcode-cn.com/problems/max-sum-of-rectangle-no-larger-than-k/

https://leetcode-cn.com/problems/frog-jump/

https://leetcode-cn.com/problems/split-array-largest-sum

https://leetcode-cn.com/problems/student-attendance-record-ii/

https://leetcode-cn.com/problems/task-scheduler/

https://leetcode-cn.com/problems/palindromic-substrings/

https://leetcode-cn.com/problems/minimum-window-substring/

https://leetcode-cn.com/problems/burst-balloons/

第六周

第十三课 | 字典树和并查集

1. Trie树的基本实现和特性

参考链接

二叉树的层次遍历

实现 Trie

Tire 树代码模板

2. Trie树实战题目解析:单词搜索2

实战题目 / 课后作业

https://leetcode-cn.com/problems/implement-trie-prefix-tree/#/description

https://leetcode-cn.com/problems/word-search-ii/

3. 并查集的基本实现、特性和实战题目解析

参考链接

岛屿数量

并查集代码模板

实战题目 / 课后作业

https://leetcode-cn.com/problems/friend-circles

https://leetcode-cn.com/problems/number-of-islands/

https://leetcode-cn.com/problems/surrounded-regions/

第十四课 | 高级搜索

1. 剪枝的实现和特性

参考链接

DFS 代码模板

BFS 代码模板

AlphaZero Explained

棋类复杂度

2. 剪枝实战题目解析:数独

实战题目

https://leetcode-cn.com/problems/climbing-stairs/

https://leetcode-cn.com/problems/generate-parentheses/

https://leetcode-cn.com/problems/n-queens

https://leetcode-cn.com/problems/valid-sudoku/description/

https://leetcode-cn.com/problems/sudoku-solver/#/description

3. 双向BFS的实现、特性和题解

实战题目

https://leetcode-cn.com/problems/word-ladder/

https://leetcode-cn.com/problems/minimum-genetic-mutation/

4. 启发式搜索的实现、特性和题解

参考链接

A* 代码模板

相似度测量方法

二进制矩阵中的最短路径的 A* 解法

8 puzzles 解法比较

实战题目

https://leetcode-cn.com/problems/shortest-path-in-binary-matrix/

https://leetcode-cn.com/problems/sliding-puzzle/

https://leetcode-cn.com/problems/sudoku-solver/

第十五课 |红黑树和 AVL树

1. AVL树和红黑树的实现和特性

参考链接

平衡树

第七周

第十六课 | 位运算

1. 位运算基础及实战要点

参考链接

如何从十进制转换为二进制

2. 位运算实战题目解析

参考链接

N 皇后位运算代码示例

实战题目 / 课后作业

https://leetcode-cn.com/problems/number-of-1-bits/

https://leetcode-cn.com/problems/power-of-two/

https://leetcode-cn.com/problems/reverse-bits/

https://leetcode-cn.com/problems/n-queens/description/

https://leetcode-cn.com/problems/n-queens-ii/description/

https://leetcode-cn.com/problems/counting-bits/description/

第十七课|布隆过滤器和LRU缓存

1. 布隆过滤器的实现及应用

参考链接

布隆过滤器的原理和实现

使用布隆过滤器解决缓存击穿、垃圾邮件识别、集合判重

布隆过滤器 Python 代码示例

布隆过滤器 Python 实现示例

高性能布隆过滤器 Python 实现示例

布隆过滤器 Java 实现示例 1

布隆过滤器 Java 实现示例 2

2. LRU Cache的实现、应用和题解

参考链接

Understanding the Meltdown exploit

替换算法总揽

LRU Cache Python 代码示例

实战题目 / 课后作业

https://leetcode-cn.com/problems/lru-cache/#/

第十八课|排序算法

1. 初级排序和高级排序的实现和特性

参考链接

十大经典排序算法

快速排序代码示例

归并排序代码示例

堆排序代码示例

直播课回顾: https://pan.baidu.com/s/1sFuZ8GjDCXy5mPCNLZhHxw 提取码: 2rdy

2. 特殊排序及实战题目详解

参考链接

十大经典排序算法

9 种经典排序算法可视化动画

6 分钟看完 15 种排序算法动画展示

实战题目 / 课后作业

https://leetcode-cn.com/problems/relative-sort-array/

https://leetcode-cn.com/problems/valid-anagram/

https://leetcode-cn.com/problems/design-a-leaderboard/

https://leetcode-cn.com/problems/merge-intervals/

https://leetcode-cn.com/problems/reverse-pairs/

第八周

第十九课|高级动态规划

About

Algorithm004-04


Languages

Language:Java 50.4%Language:Python 26.4%Language:Go 6.2%Language:C++ 6.2%Language:PHP 5.0%Language:C 2.5%Language:JavaScript 1.8%Language:HTML 1.5%