mirror of
https://github.com/krahets/hello-algo.git
synced 2025-12-19 07:17:54 +08:00
refactor: Replace 结点 with 节点 (#452)
* Replace 结点 with 节点 Update the footnotes in the figures * Update mindmap * Reduce the size of the mindmap.png
This commit is contained in:
@@ -24,16 +24,16 @@ fn main() {
|
||||
println!("\n初始化二叉树\n");
|
||||
print_util::print_tree(&n1);
|
||||
|
||||
// 插入结点与删除结点
|
||||
// 插入节点与删除节点
|
||||
let p = TreeNode::new(0);
|
||||
// 在 n1 -> n2 中间插入结点 P
|
||||
// 在 n1 -> n2 中间插入节点 P
|
||||
p.borrow_mut().left = Some(Rc::clone(&n2));
|
||||
n1.borrow_mut().left = Some(Rc::clone(&p));
|
||||
println!("\n插入结点 P 后\n");
|
||||
println!("\n插入节点 P 后\n");
|
||||
print_util::print_tree(&n1);
|
||||
// 删除结点 P
|
||||
// 删除节点 P
|
||||
drop(p);
|
||||
n1.borrow_mut().left = Some(Rc::clone(&n2));
|
||||
println!("\n删除结点 P 后\n");
|
||||
println!("\n删除节点 P 后\n");
|
||||
print_util::print_tree(&n1);
|
||||
}
|
||||
Reference in New Issue
Block a user