From f8748e6006b4342d28278bfbea737214adead91e Mon Sep 17 00:00:00 2001 From: Yudong Jin Date: Mon, 26 Dec 2022 13:14:32 +0800 Subject: [PATCH 1/4] Update space complexity. --- codes/go/chapter_computational_complexity/space_complexity.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/codes/go/chapter_computational_complexity/space_complexity.go b/codes/go/chapter_computational_complexity/space_complexity.go index 77780ae04..eb3ebec97 100644 --- a/codes/go/chapter_computational_complexity/space_complexity.go +++ b/codes/go/chapter_computational_complexity/space_complexity.go @@ -42,7 +42,7 @@ func printTree(root *TreeNode) { printTree(root.right) } -/* 函数(或称方法)*/ +/* 函数 */ func function() int { // do something... return 0 From c2662592bbcff8e173bb73a4a713616d0974d6ff Mon Sep 17 00:00:00 2001 From: Yudong Jin Date: Mon, 26 Dec 2022 13:15:09 +0800 Subject: [PATCH 2/4] Update space complexity --- .../space_complexity.md | 10 +++++----- docs/chapter_tree/summary.md | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/chapter_computational_complexity/space_complexity.md b/docs/chapter_computational_complexity/space_complexity.md index 50f2698ff..df5d98f34 100644 --- a/docs/chapter_computational_complexity/space_complexity.md +++ b/docs/chapter_computational_complexity/space_complexity.md @@ -38,7 +38,7 @@ comments: true Node(int x) { val = x; } } - /* 函数(或称方法) */ + /* 函数 */ int function() { // do something... return 0; @@ -63,7 +63,7 @@ comments: true Node(int x) : val(x), next(nullptr) {} }; - /* 函数(或称方法) */ + /* 函数 */ int func() { // do something... return 0; @@ -87,7 +87,7 @@ comments: true self.val = x # 结点值 self.next = None # 指向下一结点的指针(引用) - """ 函数(或称方法) """ + """ 函数 """ def function(): # do something... return 0 @@ -113,7 +113,7 @@ comments: true return &Node{val: val} } - /* 函数(或称方法)*/ + /* 函数 */ func function() int { // do something... return 0 @@ -157,7 +157,7 @@ comments: true Node(int x) { val = x; } } - /* 函数(或称方法) */ + /* 函数 */ int function() { // do something... diff --git a/docs/chapter_tree/summary.md b/docs/chapter_tree/summary.md index 7edfbad71..a46a253f9 100644 --- a/docs/chapter_tree/summary.md +++ b/docs/chapter_tree/summary.md @@ -15,4 +15,4 @@ comments: true - 前序、中序、后序遍历是深度优先搜索,体现着“走到头、再回头继续”的回溯遍历方式,通常使用递归实现。 - 二叉搜索树是一种高效的元素查找数据结构,查找、插入、删除操作的时间复杂度皆为 $O(\log n)$ 。二叉搜索树退化为链表后,各项时间复杂度劣化至 $O(n)$ ,因此如何避免退化是非常重要的课题。 - AVL 树又称平衡二叉搜索树,其通过旋转操作,使得在不断插入与删除结点后,仍然可以保持二叉树的平衡(不退化)。 -- AVL 树的旋转操作分为右旋、左旋、先右旋后左旋、先左旋后右旋。在插入或删除结点后,AVL 树会从底置顶地执行旋转操作,使树恢复平衡。 \ No newline at end of file +- AVL 树的旋转操作分为右旋、左旋、先右旋后左旋、先左旋后右旋。在插入或删除结点后,AVL 树会从底置顶地执行旋转操作,使树恢复平衡。 From 9a46bf1d80f4ea8335edb0b134d832ad4bebb0a0 Mon Sep 17 00:00:00 2001 From: DullSword <40877476+DullSword@users.noreply.github.com> Date: Tue, 27 Dec 2022 11:34:41 +0800 Subject: [PATCH 3/4] =?UTF-8?q?docs(chapter=5Ftree/binary=5Ftree/=E4=BA=8C?= =?UTF-8?q?=E5=8F=89=E6=A0=91=E8=A1=A8=E7=A4=BA=E6=96=B9=E5=BC=8F=20*):=20?= =?UTF-8?q?JS=20code?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 与下图及其他编程语言示例代码不一致 --- docs/chapter_tree/binary_tree.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/chapter_tree/binary_tree.md b/docs/chapter_tree/binary_tree.md index 9fc818128..891325b77 100644 --- a/docs/chapter_tree/binary_tree.md +++ b/docs/chapter_tree/binary_tree.md @@ -453,7 +453,7 @@ comments: true ```js title="" /* 二叉树的数组表示 */ // 直接使用 null 来表示空位 - let tree = [1, 2, 3, 4, 5, 6, 7, null, null, null, null, null, null, null, null] + let tree = [1, 2, 3, 4, null, 6, 7, 8, 9, null, null, 12, null, null, 15]; ``` === "TypeScript" From 142913bc9d18afc8264ed9722f7924d2a7d83ae3 Mon Sep 17 00:00:00 2001 From: DullSword <40877476+DullSword@users.noreply.github.com> Date: Tue, 27 Dec 2022 11:51:04 +0800 Subject: [PATCH 4/4] =?UTF-8?q?docs(chapter=5Ftree/binary=5Ftree/=E4=BA=8C?= =?UTF-8?q?=E5=8F=89=E6=A0=91=E8=A1=A8=E7=A4=BA=E6=96=B9=E5=BC=8F=20*):=20?= =?UTF-8?q?TS=20code?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 与下图及其他编程语言示例代码不一致 --- docs/chapter_tree/binary_tree.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/chapter_tree/binary_tree.md b/docs/chapter_tree/binary_tree.md index 9fc818128..08e267ba8 100644 --- a/docs/chapter_tree/binary_tree.md +++ b/docs/chapter_tree/binary_tree.md @@ -461,7 +461,7 @@ comments: true ```typescript title="" /* 二叉树的数组表示 */ // 直接使用 null 来表示空位 - let tree = [1, 2, 3, 4, 5, 6, 7, null, null, null, null, null, null, null, null] + let tree: (number | null)[] = [1, 2, 3, 4, null, 6, 7, 8, 9, null, null, 12, null, null, 15]; ``` === "C"