This commit is contained in:
krahets
2024-03-18 03:11:07 +08:00
parent bc0054a577
commit 54c7448946
48 changed files with 577 additions and 408 deletions

View File

@ -1291,8 +1291,8 @@ comments: true
/* 删除节点 */
pub fn remove(&mut self, num: i32) {
// 若树为空,直接提前返回
if self.root.is_none() {
return;
if self.root.is_none() {
return;
}
let mut cur = self.root.clone();
let mut pre = None;