diff --git a/docs/chapter_tree/binary_tree.md b/docs/chapter_tree/binary_tree.md index 7472ff3bf..84e788d8e 100644 --- a/docs/chapter_tree/binary_tree.md +++ b/docs/chapter_tree/binary_tree.md @@ -669,7 +669,7 @@ comments: true ### 2.   完全二叉树 -如图 7-5 所示,完全二叉树(complete binary tree)只有最底层的节点未被填满,且最底层节点尽量靠左填充。请注意,完美二叉树也是一棵完全二叉树。 +如图 7-5 所示,完全二叉树(complete binary tree)仅允许最底层的节点不完全填满,且最底层的节点必须从左至右依次连续填充。请注意,完美二叉树也是一棵完全二叉树。 ![完全二叉树](binary_tree.assets/complete_binary_tree.png){ class="animation-figure" } diff --git a/en/docs/chapter_tree/binary_tree.md b/en/docs/chapter_tree/binary_tree.md index cbb2745ae..7a2f55b68 100644 --- a/en/docs/chapter_tree/binary_tree.md +++ b/en/docs/chapter_tree/binary_tree.md @@ -110,7 +110,7 @@ A binary tree 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 perfect binary tree, all levels are complete ### 2.   Complete binary tree -As shown in Figure 7-5, a complete binary tree 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 complete binary tree 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" } diff --git a/zh-Hant/docs/chapter_tree/binary_tree.md b/zh-Hant/docs/chapter_tree/binary_tree.md index 72730f753..1c384af41 100644 --- a/zh-Hant/docs/chapter_tree/binary_tree.md +++ b/zh-Hant/docs/chapter_tree/binary_tree.md @@ -669,7 +669,7 @@ comments: true ### 2.   完全二元樹 -如圖 7-5 所示,完全二元樹(complete binary tree)只有最底層的節點未被填滿,且最底層節點儘量靠左填充。請注意,完美二元樹也是一棵完全二元樹。 +如圖 7-5 所示,完全二元樹(complete binary tree)僅允許最底層的節點不完全填滿,且最底層的節點必須從左至右依次連續填充。請注意,完美二元樹也是一棵完全二元樹。 ![完全二元樹](binary_tree.assets/complete_binary_tree.png){ class="animation-figure" }