s0538
All checks were successful
ci/woodpecker/push/test Pipeline was successful

This commit is contained in:
2023-02-01 12:54:52 +08:00
parent b2e4f6daad
commit e4ec64865b
3 changed files with 61 additions and 0 deletions

View File

@@ -5,3 +5,4 @@
- [s0450](https://leetcode.cn/problems/delete-node-in-a-bst/description/): 删除节点。递归删除。
- [s0669](https://leetcode.cn/problems/trim-a-binary-search-tree/description/): 修剪 BST 。递归修剪。
- [s0108](https://leetcode.cn/problems/convert-sorted-array-to-binary-search-tree/): 有序数组转 BST 。数组中点为根节点,中点左侧部分生成左子树,右侧部分生成右子树,递归。
- [s0538](https://leetcode.cn/problems/convert-bst-to-greater-tree/description/): BST 转累加树。可以找到每个节点的构建方法然后用直观一点的递归方式来写,不过本题有个特殊之处在于累加树的生成方式正好和反序中序遍历的遍历路径相同,因此可以用反序中序遍历来遍历生成。