mirror of
https://github.com/krahets/hello-algo.git
synced 2026-08-09 10:30:59 +00:00
cargo fmt rust code (#1131)
* cargo fmt code * Add empty line to seperate unrelated comments * Fix review * Update bubble_sort.rs * Update merge_sort.rs --------- Co-authored-by: Yudong Jin <krahets@163.com>
This commit is contained in:
@@ -6,10 +6,10 @@
|
||||
|
||||
include!("../include/include.rs");
|
||||
|
||||
use tree_node::TreeNode;
|
||||
use std::rc::Rc;
|
||||
use std::cmp::Ordering;
|
||||
use std::cell::RefCell;
|
||||
use std::cmp::Ordering;
|
||||
use std::rc::Rc;
|
||||
use tree_node::TreeNode;
|
||||
|
||||
type OptionTreeNodeRc = Option<Rc<RefCell<TreeNode>>>;
|
||||
|
||||
@@ -157,6 +157,7 @@ impl AVLTree {
|
||||
}
|
||||
}
|
||||
Self::update_height(Some(node.clone())); // 更新节点高度
|
||||
|
||||
/* 2. 执行旋转操作,使该子树重新恢复平衡 */
|
||||
node = Self::rotate(Some(node)).unwrap();
|
||||
// 返回子树的根节点
|
||||
@@ -211,6 +212,7 @@ impl AVLTree {
|
||||
node.borrow_mut().val = temp.borrow().val;
|
||||
}
|
||||
Self::update_height(Some(node.clone())); // 更新节点高度
|
||||
|
||||
/* 2. 执行旋转操作,使该子树重新恢复平衡 */
|
||||
node = Self::rotate(Some(node)).unwrap();
|
||||
// 返回子树的根节点
|
||||
|
||||
Reference in New Issue
Block a user