This commit is contained in:
krahets
2023-04-09 04:34:58 +08:00
parent adcbab4d4c
commit 01d05cc1f0
26 changed files with 1501 additions and 1247 deletions

View File

@@ -84,8 +84,8 @@ comments: true
""" 类 """
class Node:
def __init__(self, x: int):
self.val: int = x # 点值
self.next: Optional[Node] = None # 指向下一点的指针(引用)
self.val: int = x # 点值
self.next: Optional[Node] = None # 指向下一点的指针(引用)
""" 函数 """
def function() -> int:
@@ -137,8 +137,8 @@ comments: true
val;
next;
constructor(val) {
this.val = val === undefined ? 0 : val; // 点值
this.next = null; // 指向下一点的引用
this.val = val === undefined ? 0 : val; // 点值
this.next = null; // 指向下一点的引用
}
}
@@ -165,8 +165,8 @@ comments: true
val: number;
next: Node | null;
constructor(val?: number) {
this.val = val === undefined ? 0 : val; // 点值
this.next = null; // 指向下一点的引用
this.val = val === undefined ? 0 : val; // 点值
this.next = null; // 指向下一点的引用
}
}
@@ -1375,7 +1375,7 @@ $$
### 指数阶 $O(2^n)$
指数阶常见于二叉树。高度为 $n$ 的「满二叉树」的点数量为 $2^n - 1$ ,占用 $O(2^n)$ 空间。
指数阶常见于二叉树。高度为 $n$ 的「满二叉树」的点数量为 $2^n - 1$ ,占用 $O(2^n)$ 空间。
=== "Java"