This commit is contained in:
krahets
2025-04-15 15:47:00 +08:00
parent 38000b2e5e
commit ef3c49eedd
3 changed files with 4 additions and 4 deletions
+1 -1
View File
@@ -669,7 +669,7 @@ comments: true
### 2.   完全二叉树
如图 7-5 所示,<u>完全二叉树(complete binary tree</u>只有最底层的节点未被填满,且最底层节点尽量靠左填充。请注意,完美二叉树也是一棵完全二叉树。
如图 7-5 所示,<u>完全二叉树(complete binary tree</u>仅允许最底层的节点不完全填满,且最底层节点必须从左至右依次连续填充。请注意,完美二叉树也是一棵完全二叉树。
![完全二叉树](binary_tree.assets/complete_binary_tree.png){ class="animation-figure" }
+2 -2
View File
@@ -110,7 +110,7 @@ A <u>binary tree</u> is a non-linear data structure that represents the hierarch
val: number;
left: TreeNode | null;
right: TreeNode | null;
constructor(val?: number, left?: TreeNode | null, right?: TreeNode | null) {
this.val = val === undefined ? 0 : val; // Node value
this.left = left === undefined ? null : left; // Reference to left child node
@@ -637,7 +637,7 @@ As shown in Figure 7-4, in a <u>perfect binary tree</u>, all levels are complete
### 2. &nbsp; Complete binary tree
As shown in Figure 7-5, a <u>complete binary tree</u> is a binary tree where only the nodes in the bottom level are not completely filled, and the nodes in the bottom level are filled from left to right as much as possible. Please note that a perfect binary tree is also a complete binary tree.
As shown in Figure 7-5, a <u>complete binary tree</u> is a binary tree where only the bottom level is possibly not completely filled, and nodes at the bottom level must be filled continuously from left to right. Note that a perfect binary tree is also a complete binary tree.
![Complete binary tree](binary_tree.assets/complete_binary_tree.png){ class="animation-figure" }
+1 -1
View File
@@ -669,7 +669,7 @@ comments: true
### 2. &nbsp; 完全二元樹
如圖 7-5 所示,<u>完全二元樹(complete binary tree</u>只有最底層的節點未被填滿,且最底層節點儘量靠左填充。請注意,完美二元樹也是一棵完全二元樹。
如圖 7-5 所示,<u>完全二元樹(complete binary tree</u>僅允許最底層的節點不完全填滿,且最底層節點必須從左至右依次連續填充。請注意,完美二元樹也是一棵完全二元樹。
![完全二元樹](binary_tree.assets/complete_binary_tree.png){ class="animation-figure" }