Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 719b9be

Browse files
committed
更新分类题解列表
1 parent 1fdc2d3 commit 719b9be

File tree

3 files changed

+27
-5
lines changed

3 files changed

+27
-5
lines changed

‎Assets/Origins/Categories-List.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,13 @@
311311

312312
### [树形 DP 题目](../../Contents/10.Dynamic-Programming/06.Tree-DP/02.Tree-DP-List.md)
313313

314-
###### 0543. 二叉树的直径、0124. 二叉树中的最大路径和、1245. 树的直径、0310. 最小高度树、2246. 相邻字符不同的最长路径、0687. 最长同值路径、0337. 打家劫舍 III、0333. 最大 BST 子树、1617. 统计子树中城市之间最大距离、2538. 最大价值和与最小价值和的差值、0834. 树中距离之和、1569. 将子数组重新排序得到同一个二叉搜索树的方案数、1372. 二叉树中的最长交错路径、1373. 二叉搜索子树的最大键值和、0968. 监控二叉树、1273. 删除树节点、1519. 子树中标签相同的节点数
314+
#### 固定根的树形 DP 题目
315+
316+
###### 0543. 二叉树的直径、0124. 二叉树中的最大路径和、1245. 树的直径、2246. 相邻字符不同的最长路径、0687. 最长同值路径、0337. 打家劫舍 III、0333. 最大 BST 子树、1617. 统计子树中城市之间最大距离、2538. 最大价值和与最小价值和的差值、1569. 将子数组重新排序得到同一个二叉搜索树的方案数、1372. 二叉树中的最长交错路径、1373. 二叉搜索子树的最大键值和、0968. 监控二叉树、1273. 删除树节点、1519. 子树中标签相同的节点数
317+
318+
#### 不定根的树形 DP 题目
319+
320+
###### 0310. 最小高度树、0834. 树中距离之和、2581. 统计可能的树根数目
315321

316322
### [状态压缩 DP 题目](../../Contents/10.Dynamic-Programming/07.State-DP/02.State-DP-List.md)
317323

‎Contents/00.Introduction/05.Categories-List.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -997,26 +997,34 @@
997997

998998
### 树形 DP 题目
999999

1000+
#### 固定根的树形 DP 题目
1001+
10001002
| 题号 | 标题 | 题解 | 标签 | 难度 |
10011003
| :------ | :------ | :------ | :------ | :------ |
10021004
| 0543 | [二叉树的直径](https://leetcode.cn/problems/diameter-of-binary-tree/) | [Python](https://github.com/itcharge/LeetCode-Py/blob/main/Solutions/0543.%20%E4%BA%8C%E5%8F%89%E6%A0%91%E7%9A%84%E7%9B%B4%E5%BE%84.md) | 树、深度优先搜索、二叉树 | 简单 |
10031005
| 0124 | [二叉树中的最大路径和](https://leetcode.cn/problems/binary-tree-maximum-path-sum/) | [Python](https://github.com/itcharge/LeetCode-Py/blob/main/Solutions/0124.%20%E4%BA%8C%E5%8F%89%E6%A0%91%E4%B8%AD%E7%9A%84%E6%9C%80%E5%A4%A7%E8%B7%AF%E5%BE%84%E5%92%8C.md) | 树、深度优先搜索、动态规划、二叉树 | 困难 |
10041006
| 1245 | [树的直径](https://leetcode.cn/problems/tree-diameter/) | [Python](https://github.com/itcharge/LeetCode-Py/blob/main/Solutions/1245.%20%E6%A0%91%E7%9A%84%E7%9B%B4%E5%BE%84.md) | 树、深度优先搜索、广度优先搜索、图、拓扑排序 | 中等 |
1005-
| 0310 | [最小高度树](https://leetcode.cn/problems/minimum-height-trees/) | | 深度优先搜索、广度优先搜索、图、拓扑排序 | 中等 |
10061007
| 2246 | [相邻字符不同的最长路径](https://leetcode.cn/problems/longest-path-with-different-adjacent-characters/) | [Python](https://github.com/itcharge/LeetCode-Py/blob/main/Solutions/2246.%20%E7%9B%B8%E9%82%BB%E5%AD%97%E7%AC%A6%E4%B8%8D%E5%90%8C%E7%9A%84%E6%9C%80%E9%95%BF%E8%B7%AF%E5%BE%84.md) | 树、深度优先搜索、图、拓扑排序、数组、字符串 | 困难 |
10071008
| 0687 | [最长同值路径](https://leetcode.cn/problems/longest-univalue-path/) | [Python](https://github.com/itcharge/LeetCode-Py/blob/main/Solutions/0687.%20%E6%9C%80%E9%95%BF%E5%90%8C%E5%80%BC%E8%B7%AF%E5%BE%84.md) | 树、深度优先搜索、二叉树 | 中等 |
10081009
| 0337 | [打家劫舍 III](https://leetcode.cn/problems/house-robber-iii/) | [Python](https://github.com/itcharge/LeetCode-Py/blob/main/Solutions/0337.%20%E6%89%93%E5%AE%B6%E5%8A%AB%E8%88%8D%20III.md) | 树、深度优先搜索、动态规划、二叉树 | 中等 |
10091010
| 0333 | [最大 BST 子树](https://leetcode.cn/problems/largest-bst-subtree/) | | 树、深度优先搜索、二叉搜索树、动态规划、二叉树 | 中等 |
10101011
| 1617 | [统计子树中城市之间最大距离](https://leetcode.cn/problems/count-subtrees-with-max-distance-between-cities/) | [Python](https://github.com/itcharge/LeetCode-Py/blob/main/Solutions/1617.%20%E7%BB%9F%E8%AE%A1%E5%AD%90%E6%A0%91%E4%B8%AD%E5%9F%8E%E5%B8%82%E4%B9%8B%E9%97%B4%E6%9C%80%E5%A4%A7%E8%B7%9D%E7%A6%BB.md) | 位运算、树、动态规划、状态压缩、枚举 | 困难 |
10111012
| 2538 | [最大价值和与最小价值和的差值](https://leetcode.cn/problems/difference-between-maximum-and-minimum-price-sum/) | [Python](https://github.com/itcharge/LeetCode-Py/blob/main/Solutions/2538.%20%E6%9C%80%E5%A4%A7%E4%BB%B7%E5%80%BC%E5%92%8C%E4%B8%8E%E6%9C%80%E5%B0%8F%E4%BB%B7%E5%80%BC%E5%92%8C%E7%9A%84%E5%B7%AE%E5%80%BC.md) | 树、深度优先搜索、数组、动态规划 | 困难 |
1012-
| 0834 | [树中距离之和](https://leetcode.cn/problems/sum-of-distances-in-tree/) | | 树、深度优先搜索、图、动态规划 | 困难 |
10131013
| 1569 | [将子数组重新排序得到同一个二叉搜索树的方案数](https://leetcode.cn/problems/number-of-ways-to-reorder-array-to-get-same-bst/) | | 树、并查集、二叉搜索树、记忆化搜索、数组、数学、分治、动态规划、二叉树、组合数学 | 困难 |
10141014
| 1372 | [二叉树中的最长交错路径](https://leetcode.cn/problems/longest-zigzag-path-in-a-binary-tree/) | | 树、深度优先搜索、动态规划、二叉树 | 中等 |
10151015
| 1373 | [二叉搜索子树的最大键值和](https://leetcode.cn/problems/maximum-sum-bst-in-binary-tree/) | | 树、深度优先搜索、二叉搜索树、动态规划、二叉树 | 困难 |
10161016
| 0968 | [监控二叉树](https://leetcode.cn/problems/binary-tree-cameras/) | [Python](https://github.com/itcharge/LeetCode-Py/blob/main/Solutions/0968.%20%E7%9B%91%E6%8E%A7%E4%BA%8C%E5%8F%89%E6%A0%91.md) | 树、深度优先搜索、动态规划、二叉树 | 困难 |
10171017
| 1273 | [删除树节点](https://leetcode.cn/problems/delete-tree-nodes/) | | 树、深度优先搜索、广度优先搜索 | 中等 |
10181018
| 1519 | [子树中标签相同的节点数](https://leetcode.cn/problems/number-of-nodes-in-the-sub-tree-with-the-same-label/) | | 树、深度优先搜索、广度优先搜索、哈希表、计数 | 中等 |
10191019

1020+
#### 不定根的树形 DP 题目
1021+
1022+
| 题号 | 标题 | 题解 | 标签 | 难度 |
1023+
| :------ | :------ | :------ | :------ | :------ |
1024+
| 0310 | [最小高度树](https://leetcode.cn/problems/minimum-height-trees/) | | 深度优先搜索、广度优先搜索、图、拓扑排序 | 中等 |
1025+
| 0834 | [树中距离之和](https://leetcode.cn/problems/sum-of-distances-in-tree/) | | 树、深度优先搜索、图、动态规划 | 困难 |
1026+
| 2581 | [统计可能的树根数目](https://leetcode.cn/problems/count-number-of-possible-root-nodes/) | | 树、深度优先搜索、哈希表、动态规划 | 困难 |
1027+
10201028
### 状态压缩 DP 题目
10211029

10221030
| 题号 | 标题 | 题解 | 标签 | 难度 |
Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,30 @@
11
### 树形 DP 题目
22

3+
#### 固定根的树形 DP 题目
4+
35
| 题号 | 标题 | 题解 | 标签 | 难度 |
46
| :------ | :------ | :------ | :------ | :------ |
57
| 0543 | [二叉树的直径](https://leetcode.cn/problems/diameter-of-binary-tree/) | [Python](https://github.com/itcharge/LeetCode-Py/blob/main/Solutions/0543.%20%E4%BA%8C%E5%8F%89%E6%A0%91%E7%9A%84%E7%9B%B4%E5%BE%84.md) | 树、深度优先搜索、二叉树 | 简单 |
68
| 0124 | [二叉树中的最大路径和](https://leetcode.cn/problems/binary-tree-maximum-path-sum/) | [Python](https://github.com/itcharge/LeetCode-Py/blob/main/Solutions/0124.%20%E4%BA%8C%E5%8F%89%E6%A0%91%E4%B8%AD%E7%9A%84%E6%9C%80%E5%A4%A7%E8%B7%AF%E5%BE%84%E5%92%8C.md) | 树、深度优先搜索、动态规划、二叉树 | 困难 |
79
| 1245 | [树的直径](https://leetcode.cn/problems/tree-diameter/) | [Python](https://github.com/itcharge/LeetCode-Py/blob/main/Solutions/1245.%20%E6%A0%91%E7%9A%84%E7%9B%B4%E5%BE%84.md) | 树、深度优先搜索、广度优先搜索、图、拓扑排序 | 中等 |
8-
| 0310 | [最小高度树](https://leetcode.cn/problems/minimum-height-trees/) | | 深度优先搜索、广度优先搜索、图、拓扑排序 | 中等 |
910
| 2246 | [相邻字符不同的最长路径](https://leetcode.cn/problems/longest-path-with-different-adjacent-characters/) | [Python](https://github.com/itcharge/LeetCode-Py/blob/main/Solutions/2246.%20%E7%9B%B8%E9%82%BB%E5%AD%97%E7%AC%A6%E4%B8%8D%E5%90%8C%E7%9A%84%E6%9C%80%E9%95%BF%E8%B7%AF%E5%BE%84.md) | 树、深度优先搜索、图、拓扑排序、数组、字符串 | 困难 |
1011
| 0687 | [最长同值路径](https://leetcode.cn/problems/longest-univalue-path/) | [Python](https://github.com/itcharge/LeetCode-Py/blob/main/Solutions/0687.%20%E6%9C%80%E9%95%BF%E5%90%8C%E5%80%BC%E8%B7%AF%E5%BE%84.md) | 树、深度优先搜索、二叉树 | 中等 |
1112
| 0337 | [打家劫舍 III](https://leetcode.cn/problems/house-robber-iii/) | [Python](https://github.com/itcharge/LeetCode-Py/blob/main/Solutions/0337.%20%E6%89%93%E5%AE%B6%E5%8A%AB%E8%88%8D%20III.md) | 树、深度优先搜索、动态规划、二叉树 | 中等 |
1213
| 0333 | [最大 BST 子树](https://leetcode.cn/problems/largest-bst-subtree/) | | 树、深度优先搜索、二叉搜索树、动态规划、二叉树 | 中等 |
1314
| 1617 | [统计子树中城市之间最大距离](https://leetcode.cn/problems/count-subtrees-with-max-distance-between-cities/) | [Python](https://github.com/itcharge/LeetCode-Py/blob/main/Solutions/1617.%20%E7%BB%9F%E8%AE%A1%E5%AD%90%E6%A0%91%E4%B8%AD%E5%9F%8E%E5%B8%82%E4%B9%8B%E9%97%B4%E6%9C%80%E5%A4%A7%E8%B7%9D%E7%A6%BB.md) | 位运算、树、动态规划、状态压缩、枚举 | 困难 |
1415
| 2538 | [最大价值和与最小价值和的差值](https://leetcode.cn/problems/difference-between-maximum-and-minimum-price-sum/) | [Python](https://github.com/itcharge/LeetCode-Py/blob/main/Solutions/2538.%20%E6%9C%80%E5%A4%A7%E4%BB%B7%E5%80%BC%E5%92%8C%E4%B8%8E%E6%9C%80%E5%B0%8F%E4%BB%B7%E5%80%BC%E5%92%8C%E7%9A%84%E5%B7%AE%E5%80%BC.md) | 树、深度优先搜索、数组、动态规划 | 困难 |
15-
| 0834 | [树中距离之和](https://leetcode.cn/problems/sum-of-distances-in-tree/) | | 树、深度优先搜索、图、动态规划 | 困难 |
1616
| 1569 | [将子数组重新排序得到同一个二叉搜索树的方案数](https://leetcode.cn/problems/number-of-ways-to-reorder-array-to-get-same-bst/) | | 树、并查集、二叉搜索树、记忆化搜索、数组、数学、分治、动态规划、二叉树、组合数学 | 困难 |
1717
| 1372 | [二叉树中的最长交错路径](https://leetcode.cn/problems/longest-zigzag-path-in-a-binary-tree/) | | 树、深度优先搜索、动态规划、二叉树 | 中等 |
1818
| 1373 | [二叉搜索子树的最大键值和](https://leetcode.cn/problems/maximum-sum-bst-in-binary-tree/) | | 树、深度优先搜索、二叉搜索树、动态规划、二叉树 | 困难 |
1919
| 0968 | [监控二叉树](https://leetcode.cn/problems/binary-tree-cameras/) | [Python](https://github.com/itcharge/LeetCode-Py/blob/main/Solutions/0968.%20%E7%9B%91%E6%8E%A7%E4%BA%8C%E5%8F%89%E6%A0%91.md) | 树、深度优先搜索、动态规划、二叉树 | 困难 |
2020
| 1273 | [删除树节点](https://leetcode.cn/problems/delete-tree-nodes/) | | 树、深度优先搜索、广度优先搜索 | 中等 |
2121
| 1519 | [子树中标签相同的节点数](https://leetcode.cn/problems/number-of-nodes-in-the-sub-tree-with-the-same-label/) | | 树、深度优先搜索、广度优先搜索、哈希表、计数 | 中等 |
2222

23+
#### 不定根的树形 DP 题目
24+
25+
| 题号 | 标题 | 题解 | 标签 | 难度 |
26+
| :------ | :------ | :------ | :------ | :------ |
27+
| 0310 | [最小高度树](https://leetcode.cn/problems/minimum-height-trees/) | | 深度优先搜索、广度优先搜索、图、拓扑排序 | 中等 |
28+
| 0834 | [树中距离之和](https://leetcode.cn/problems/sum-of-distances-in-tree/) | | 树、深度优先搜索、图、动态规划 | 困难 |
29+
| 2581 | [统计可能的树根数目](https://leetcode.cn/problems/count-number-of-possible-root-nodes/) | | 树、深度优先搜索、哈希表、动态规划 | 困难 |
30+

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /