mirror of
https://github.com/krahets/hello-algo.git
synced 2025-11-03 05:27:55 +08:00
Bug fixes and improvements (#1735)
* Fix the definition of "complete binary tree" in binary_tree.md * Update en/README.md
This commit is contained in:
@ -655,7 +655,7 @@
|
|||||||
|
|
||||||
### 完全二叉树
|
### 完全二叉树
|
||||||
|
|
||||||
如下图所示,<u>完全二叉树(complete binary tree)</u>只有最底层的节点未被填满,且最底层节点尽量靠左填充。请注意,完美二叉树也是一棵完全二叉树。
|
如下图所示,<u>完全二叉树(complete binary tree)</u>仅允许最底层的节点不完全填满,且最底层的节点必须从左至右依次连续填充。请注意,完美二叉树也是一棵完全二叉树。
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|||||||
@ -4,7 +4,7 @@
|
|||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p align="center">
|
<p align="center">
|
||||||
<img style="height: 60px;" src="https://readme-typing-svg.demolab.com?font=Noto+Sans+SC&weight=500&duration=3500&pause=2000&color=21C8B8¢er=true&vCenter=true&random=false&width=200&lines=Hello%2C+Algo+!" alt="hello-algo-typing-svg" />
|
<img style="height: 60px;" src="https://readme-typing-svg.demolab.com?font=Roboto&weight=400&duration=3500&pause=2000&color=21C8B8¢er=true&vCenter=true&random=false&width=200&lines=Hello%2C+Algo+!" alt="hello-algo-typing-svg" />
|
||||||
</br>
|
</br>
|
||||||
Data structures and algorithms crash course with animated illustrations and off-the-shelf code
|
Data structures and algorithms crash course with animated illustrations and off-the-shelf code
|
||||||
</p>
|
</p>
|
||||||
|
|||||||
@ -106,7 +106,7 @@ A <u>binary tree</u> is a non-linear data structure that represents the hierarch
|
|||||||
val: number;
|
val: number;
|
||||||
left: TreeNode | null;
|
left: TreeNode | null;
|
||||||
right: TreeNode | null;
|
right: TreeNode | null;
|
||||||
|
|
||||||
constructor(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.val = val === undefined ? 0 : val; // Node value
|
||||||
this.left = left === undefined ? null : left; // Reference to left child node
|
this.left = left === undefined ? null : left; // Reference to left child node
|
||||||
@ -625,7 +625,7 @@ As shown in the figure below, in a <u>perfect binary tree</u>, all levels are co
|
|||||||
|
|
||||||
### Complete binary tree
|
### Complete binary tree
|
||||||
|
|
||||||
As shown in the figure below, 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 the figure below, 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.
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|||||||
@ -655,7 +655,7 @@
|
|||||||
|
|
||||||
### 完全二元樹
|
### 完全二元樹
|
||||||
|
|
||||||
如下圖所示,<u>完全二元樹(complete binary tree)</u>只有最底層的節點未被填滿,且最底層節點儘量靠左填充。請注意,完美二元樹也是一棵完全二元樹。
|
如下圖所示,<u>完全二元樹(complete binary tree)</u>僅允許最底層的節點不完全填滿,且最底層的節點必須從左至右依次連續填充。請注意,完美二元樹也是一棵完全二元樹。
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user