mirror of
https://github.com/krahets/hello-algo.git
synced 2026-06-28 00:24:21 +00:00
Update .gitignore
Add build script for Zig.
This commit is contained in:
@@ -92,7 +92,7 @@ comments: true
|
||||
=== "Zig"
|
||||
|
||||
```zig title="binary_search_tree.zig"
|
||||
|
||||
[class]{BinarySearchTree}-[func]{search}
|
||||
```
|
||||
|
||||
### 插入结点
|
||||
@@ -163,7 +163,7 @@ comments: true
|
||||
=== "Zig"
|
||||
|
||||
```zig title="binary_search_tree.zig"
|
||||
|
||||
[class]{BinarySearchTree}-[func]{insert}
|
||||
```
|
||||
|
||||
为了插入结点,需要借助 **辅助结点 `pre`** 保存上一轮循环的结点,这样在遍历到 $\text{null}$ 时,我们也可以获取到其父结点,从而完成结点插入操作。
|
||||
@@ -275,7 +275,9 @@ comments: true
|
||||
=== "Zig"
|
||||
|
||||
```zig title="binary_search_tree.zig"
|
||||
[class]{BinarySearchTree}-[func]{remove}
|
||||
|
||||
[class]{BinarySearchTree}-[func]{getInOrderNext}
|
||||
```
|
||||
|
||||
### 排序
|
||||
|
||||
Reference in New Issue
Block a user