diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md deleted file mode 100644 index df5b18869159d92ecd755248692ea646ff55bc08..0000000000000000000000000000000000000000 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ /dev/null @@ -1,21 +0,0 @@ ---- -name: 发现问题 -about: 我发现了某处链接或者知识点的错误 -title: 'bug ' -labels: bug -assignees: '' - ---- - - - -你好,我发现如下文章有 bug(点击文字可跳转到相关文章): - -[动态规划系列/抢房子.md](https://github.com/labuladong/fucking-algorithm/blob/master/动态规划系列/抢房子.md) - -问题描述: - -某章图片链接失效/其中的 XXX 内容有误/等等。 diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml new file mode 100644 index 0000000000000000000000000000000000000000..a22c9e4303dcf2b40c50879414b8311d38184c82 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -0,0 +1,44 @@ +name: 报告错误的解法代码 +title: "[bug] {这里替换为出错的力扣题号和题目} {这里替换为出错的编程语言}" +description: +labels: [ "code bug" ] +body: + - type: checkboxes + attributes: + label: Search before asking + description: > + 请先搜索 [issues](https://github.com/labuladong/fucking-algorithm/issues) 确保你提的这个 bug 还没有被提交过。 + options: + - label: > + 我已经搜索过 [issues](https://github.com/labuladong/fucking-algorithm/issues),没有发现相同的 bug。 + required: true + - type: input + attributes: + label: 出错的题目链接 + description: | + 输入力扣的题目链接 + placeholder: e.g. https://leetcode.cn/problems/search-a-2d-matrix/ + validations: + required: true + - type: textarea + attributes: + label: 报错信息 + description: | + 把出错的原因复制粘贴在这里 + value: | + + ``` + + ``` + validations: + required: true + - type: checkboxes + attributes: + label: 你是否愿意提交 PR 修复这个 bug? + description: > + PR 规范 [见这里](https://github.com/labuladong/fucking-algorithm/issues/1113),欢迎成为本仓库的 contributor! + options: + - label: 我愿意! + - type: markdown + attributes: + value: "感谢你的支持,刷题全家桶会因你变得越来越好!" \ No newline at end of file diff --git "a/\346\225\260\346\215\256\347\273\223\346\236\204\347\263\273\345\210\227/\344\272\214\345\217\211\346\240\221\346\200\273\347\273\223.md" "b/\346\225\260\346\215\256\347\273\223\346\236\204\347\263\273\345\210\227/\344\272\214\345\217\211\346\240\221\346\200\273\347\273\223.md" index 4cfd882b59cdd6f7eb1eaa4a868158617df13283..128abf5f895ccc974218324e374612f44fa9b6c9 100644 --- "a/\346\225\260\346\215\256\347\273\223\346\236\204\347\263\273\345\210\227/\344\272\214\345\217\211\346\240\221\346\200\273\347\273\223.md" +++ "b/\346\225\260\346\215\256\347\273\223\346\236\204\347\263\273\345\210\227/\344\272\214\345\217\211\346\240\221\346\200\273\347\273\223.md" @@ -1,6 +1,6 @@ --- title: '东哥手把手带你刷二叉树(纲领篇)' -tags: ['数据结构', '二叉树', '分解问题的思路', '遍历的思路'] +tags: ['数据结构', '二叉树', '分解问题的思路', '遍历的思路', '核心框架'] ---

@@ -376,7 +376,7 @@ List preorderTraverse(TreeNode root) { 一个原因是**这个算法的复杂度不好把控**,比较依赖语言特性。 -Java 的话无论 ArrayList 还是 LinkedList,`addAll` 方法的复杂度都是 O(N),所以总体的最坏时间复杂度会达到 O(N^2),除非你自己实现一个复杂度为 O(1) 的 `addAll` 方法,底层用链表的话并不是不可能。 +Java 的话无论 ArrayList 还是 LinkedList,`addAll` 方法的复杂度都是 O(N),所以总体的最坏时间复杂度会达到 O(N^2),除非你自己实现一个复杂度为 O(1) 的 `addAll` 方法,底层用链表的话是可以做到的,因为多条链表只要简单的指针操作就能连接起来。 当然,最主要的原因还是因为教科书上从来没有这么教过…… @@ -454,7 +454,7 @@ int count(TreeNode root) { } ``` -这两个问题的根本区别在于:一个节点在第几层,你从根节点遍历过来的过程就能顺带记录;而以一个节点为根的整棵子树有多少个节点,你需要遍历完子树之后才能数清楚。 +**这两个问题的根本区别在于:一个节点在第几层,你从根节点遍历过来的过程就能顺带记录,用递归函数的参数就能传递下去;而以一个节点为根的整棵子树有多少个节点,你需要遍历完子树之后才能数清楚,然后通过递归函数的返回值拿到答案**。 结合这两个简单的问题,你品味一下后序位置的特点,只有后序位置才能通过返回值获取子树的信息。