算法训练营

2020/03/02 posted in  测试
Tags:  #code

两个月的算法学习,更新一下算法总结

相关文档

数据结构
算法
自顶向下的编程方式
算法复杂度
时间复杂度

算法题汇总

第一周

两数之和题目: https://leetcode-cn.com/problems/two-sum/
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/ (高频老题)
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/

预习题目
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/

第二周

https://leetcode-cn.com/problems/valid-anagram/description/
https://leetcode-cn.com/problems/group-anagrams/
https://leetcode-cn.com/problems/two-sum/description/

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/

实战题目
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/

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

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/

第三周

实战题目
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/

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/

实战题目
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/

第四周

期中考

第五周

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/

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/

实战题目
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/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/
注意:请大家先消化前面的实战题目,高级 DP 的方法和题解会在课程后面解锁。

课后作业
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/

第六周

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

https://leetcode-cn.com/problems/friend-circles
https://leetcode-cn.com/problems/number-of-islands/
https://leetcode-cn.com/problems/surrounded-regions/

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

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

实战题目
https://leetcode-cn.com/problems/shortest-path-in-binary-matrix/
https://leetcode-cn.com/problems/sliding-puzzle/
https://leetcode-cn.com/problems/sudoku-solver/

第七周

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/

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

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/

第八周

https://leetcode-cn.com/problems/longest-increasing-subsequence/
https://leetcode-cn.com/problems/decode-ways/
https://leetcode-cn.com/problems/longest-valid-parentheses/
https://leetcode-cn.com/problems/maximal-rectangle/
https://leetcode-cn.com/problems/distinct-subsequences/
https://leetcode-cn.com/problems/race-car/

字符串基础问题
https://leetcode-cn.com/problems/to-lower-case/
https://leetcode-cn.com/problems/length-of-last-word/
https://leetcode-cn.com/problems/jewels-and-stones/
https://leetcode-cn.com/problems/first-unique-character-in-a-string/
https://leetcode-cn.com/problems/string-to-integer-atoi/
字符串操作问题
https://leetcode-cn.com/problems/longest-common-prefix/description/
https://leetcode-cn.com/problems/reverse-string
https://leetcode-cn.com/problems/reverse-string-ii/
https://leetcode-cn.com/problems/reverse-words-in-a-string/
https://leetcode-cn.com/problems/reverse-words-in-a-string-iii/
https://leetcode-cn.com/problems/reverse-only-letters/
异位词问题
https://leetcode-cn.com/problems/valid-anagram/
https://leetcode-cn.com/problems/group-anagrams/
https://leetcode-cn.com/problems/find-all-anagrams-in-a-string/
回文串问题
https://leetcode-cn.com/problems/valid-palindrome/
https://leetcode-cn.com/problems/valid-palindrome-ii/
https://leetcode-cn.com/problems/longest-palindromic-substring/

最长子串、子序列问题
https://leetcode-cn.com/problems/longest-common-subsequence/
https://leetcode-cn.com/problems/edit-distance/
https://leetcode-cn.com/problems/longest-palindromic-substring/
字符串 +DP 问题
https://leetcode-cn.com/problems/regular-expression-matching/
https://leetcode-cn.com/problems/regular-expression-matching/solution/ji-yu-guan-fang-ti-jie-gen-xiang-xi-de-jiang-jie-b/
https://leetcode-cn.com/problems/wildcard-matching/
https://leetcode-cn.com/problems/distinct-subsequences/

课后作业
https://leetcode-cn.com/problems/first-unique-character-in-a-string/
https://leetcode-cn.com/problems/string-to-integer-atoi/
https://leetcode-cn.com/problems/reverse-string-ii/
https://leetcode-cn.com/problems/reverse-words-in-a-string/
https://leetcode-cn.com/problems/reverse-words-in-a-string-iii/
https://leetcode-cn.com/problems/reverse-only-letters/
https://leetcode-cn.com/problems/find-all-anagrams-in-a-string/
https://leetcode-cn.com/problems/longest-palindromic-substring/
https://leetcode-cn.com/problems/isomorphic-strings/
https://leetcode-cn.com/problems/valid-palindrome-ii/
https://leetcode-cn.com/problems/wildcard-matching
https://leetcode-cn.com/problems/longest-valid-parentheses
https://leetcode-cn.com/problems/distinct-subsequences/

做完国内站查看相关题解之后,要到国际站看看国际高手的题解。

代码模板

待更新

其它

最后晒晒自己在极客的毕业证书