Skip to content

tiny1990/leetcode

Repository files navigation

写在最前面

$ 毕业到现在,很遗憾没怎么经历过算法的笔试面试,总感觉是一个缺陷
$ 2019年618之后休了7天假期,开启了做题之旅
$ 做了100+题发现,代码质量有所提升
$ 也理解了像头条类公司,很注重算法功底
$ 现在开始,分Tag笔记做过的题

2020 年补齐解题思路 & 图解
尝试一门新语言实现

字符串(5/138)

编号 Leetcode 题解
5 https://leetcode-cn.com/problems/longest-palindromic-substring/ 最长回文子串
28 https://leetcode-cn.com/problems/implement-strstr 实现 strStr()
125 https://leetcode-cn.com/problems/longest-palindromic-substring/ 验证回文串
409 https://leetcode-cn.com/problems/longest-palindrome/ 最长回文串
516 https://leetcode-cn.com/problems/longest-palindromic-subsequence/ 最长回文子序列

二分查找

编号 Leetcode 题解
29 https://leetcode-cn.com/problems/divide-two-integers/ 两数相除
33 https://leetcode-cn.com/problems/search-in-rotated-sorted-array/ 搜索旋转排序数组
50 https://leetcode-cn.com/problems/powx-n/ Pow(x, n)
69 https://leetcode-cn.com/problems/sqrtx x 的平方根
74 https://leetcode-cn.com/problems/search-a-2d-matrix/ 搜索二维矩阵
153 https://leetcode-cn.com/problems/find-minimum-in-rotated-sorted-array/ 寻找旋转排序数组中的最小值
162 https://leetcode-cn.com/problems/find-peak-element/ 寻找峰值
240 https://leetcode-cn.com/problems/search-a-2d-matrix-ii/ 搜索二维矩阵 II
278 https://leetcode-cn.com/problems/first-bad-version/ 第一个错误的版本
704 https://leetcode-cn.com/problems/binary-search/ 二分查找
852 https://leetcode-cn.com/problems/peak-index-in-a-mountain-array/ 山脉数组的峰顶索引

二叉树 && 分治法

编号 Leetcode 题解
94 https://leetcode-cn.com/problems/binary-tree-inorder-traversal/ 二叉树的中序遍历
98 https://leetcode-cn.com/problems/validate-binary-search-tree/ 验证二叉搜索树
104 https://leetcode-cn.com/problems/maximum-depth-of-binary-tree/ 二叉树的最大深度
110 https://leetcode-cn.com/problems/balanced-binary-tree/ 平衡二叉树
114 https://leetcode-cn.com/problems/flatten-binary-tree-to-linked-list/ 二叉树展开为链表
144 https://leetcode-cn.com/problems/binary-tree-preorder-traversal/ 二叉树的前序遍历
145 https://leetcode-cn.com/problems/binary-tree-postorder-traversal/ 二叉树的后序遍历
230 https://leetcode-cn.com/problems/kth-smallest-element-in-a-bst/ 二叉搜索树中第K小的元素
236 https://leetcode-cn.com/problems/lowest-common-ancestor-of-a-binary-tree/ 二叉树的最近公共祖先
257 https://leetcode-cn.com/problems/binary-tree-paths/ 二叉树的所有路径
270 https://leetcode-cn.com/problems/closest-binary-search-tree-value/ 最接近的二叉搜索树值
701 https://leetcode-cn.com/problems/insert-into-a-binary-search-tree/ 二叉搜索树中的插入操作

BFS

编号 Leetcode 题解
102 https://leetcode-cn.com/problems/binary-tree-level-order-traversal/ 二叉树的层次遍历
103 https://leetcode-cn.com/problems/binary-tree-zigzag-level-order-traversal/ 二叉树的锯齿形层次遍历
107 https://leetcode-cn.com/problems/binary-tree-level-order-traversal-ii/ 二叉树的层次遍历 II
133 https://leetcode-cn.com/problems/clone-graph/ 克隆图
200 https://leetcode-cn.com/problems/number-of-islands/ 岛屿数量
297 https://leetcode-cn.com/problems/serialize-and-deserialize-binary-tree/ 二叉树的序列化与反序列化

DFS

编号 Leetcode 题解
39 https://leetcode-cn.com/problems/combination-sum/ 组合总和
40 https://leetcode-cn.com/problems/combination-sum-ii/ 组合总和 II
46 https://leetcode-cn.com/problems/permutations/ 全排列
47 https://leetcode-cn.com/problems/permutations-ii/ 全排列 II
78 https://leetcode-cn.com/problems/subsets/ 子集

数组 & 链表

编号 Leetcode 题解
21 https://leetcode-cn.com/problems/merge-two-sorted-lists/ 合并两个有序链表
24 https://leetcode-cn.com/problems/swap-nodes-in-pairs/ 两两交换链表中的节点
61 https://leetcode-cn.com/problems/rotate-list/ 旋转链表
86 https://leetcode-cn.com/problems/partition-list/ 分隔链表
92 https://leetcode-cn.com/problems/reverse-linked-list-ii/ 反转链表 II
141 https://leetcode-cn.com/problems/linked-list-cycle/ 环形链表
142 https://leetcode-cn.com/problems/linked-list-cycle-ii/ 环形链表 II
143 https://leetcode-cn.com/problems/reorder-list/ 重排链表
148 https://leetcode-cn.com/problems/sort-list/ 排序链表
4 https://leetcode-cn.com/problems/median-of-two-sorted-arrays/ 寻找两个有序数组的中位数
53 https://leetcode-cn.com/problems/maximum-subarray/ 最大子序和
88 https://leetcode-cn.com/problems/merge-sorted-array/ 合并两个有序数组
349 https://leetcode-cn.com/problems/intersection-of-two-arrays/ 两个数组的交集

双指针

编号 Leetcode 题解
27 https://leetcode-cn.com/problems/remove-element/ 移除元素
42 https://leetcode-cn.com/problems/trapping-rain-water/ 接雨水
125 https://leetcode-cn.com/problems/valid-palindrome/ 验证回文串
1 https://leetcode-cn.com/problems/two-sum/ 两数之和
15 https://leetcode-cn.com/problems/3sum/ 三数之和
16 https://leetcode-cn.com/problems/3sum-closest/ 最接近的三数之和
167 https://leetcode-cn.com/problems/two-sum-ii-input-array-is-sorted/ 两数之和 II - 输入有序数组
170 https://leetcode-cn.com/problems/two-sum-iii-data-structure-design/ 两数之和 III - 数据结构设计
611 https://leetcode-cn.com/problems/valid-triangle-number/ 有效三角形的个数
75 https://leetcode-cn.com/problems/sort-colors/ 颜色分类
905 https://leetcode-cn.com/problems/sort-array-by-parity/ 按奇偶排序数组

Data Structure

编号 Leetcode 题解
128 https://leetcode-cn.com/problems/longest-consecutive-sequence/最长连续序列 最长连续序列
138 https://leetcode-cn.com/problems/copy-list-with-random-pointer/ 复制带随机指针的链表
146 https://leetcode-cn.com/problems/lru-cache/ LRU缓存机制
674 https://leetcode-cn.com/problems/longest-continuous-increasing-subsequence/ 最长连续递增序列
263 https://leetcode-cn.com/problems/ugly-number/ 丑数
973 https://leetcode-cn.com/problems/k-closest-points-to-origin/ 最接近原点的 K 个点

DP

编号 Leetcode 题解
45 https://leetcode-cn.com/problems/jump-game-ii/ 跳跃游戏 II
55 https://leetcode-cn.com/problems/jump-game/ 跳跃游戏
62 https://leetcode-cn.com/problems/unique-paths/ 不同路径
63 https://leetcode-cn.com/problems/unique-paths-ii/ 不同路径 II
64 https://leetcode-cn.com/problems/minimum-path-sum/ 最小路径和
70 https://leetcode-cn.com/problems/climbing-stairs/ 爬楼梯
120 https://leetcode-cn.com/problems/triangle/ 三角形最小路径和
300 https://leetcode-cn.com/problems/longest-increasing-subsequence/ 最长上升子序列

Releases

No releases published

Packages

No packages published