mirror of
https://github.com/krahets/hello-algo.git
synced 2025-12-19 07:17:54 +08:00
feat: add rust codes for chapter computational complexity (#714)
This commit is contained in:
@@ -76,7 +76,7 @@ impl BinarySearchTree {
|
||||
pub fn insert(&mut self, num: i32) {
|
||||
// 若树为空,则初始化根节点
|
||||
if self.root.is_none() {
|
||||
self.root = TreeNode::new(num);
|
||||
self.root = Some(TreeNode::new(num));
|
||||
return;
|
||||
}
|
||||
let mut cur = self.root.clone();
|
||||
|
||||
Reference in New Issue
Block a user