mirror of
https://github.com/krahets/hello-algo.git
synced 2024-12-26 01:06:28 +08:00
Fix function call error and null safety (#491)
This commit is contained in:
parent
b52a98f178
commit
541f384e7c
2 changed files with 2 additions and 2 deletions
|
@ -143,7 +143,7 @@ class AVLTree {
|
||||||
while (temp!.left != null) {
|
while (temp!.left != null) {
|
||||||
temp = temp.left;
|
temp = temp.left;
|
||||||
}
|
}
|
||||||
node.right = removeHelper(node.right, temp!.val);
|
node.right = removeHelper(node.right, temp.val);
|
||||||
node.val = temp.val;
|
node.val = temp.val;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -135,7 +135,7 @@ void main() {
|
||||||
print("\n查找到的节点对象为 $node,节点值 = ${node?.val}");
|
print("\n查找到的节点对象为 $node,节点值 = ${node?.val}");
|
||||||
|
|
||||||
/* 插入节点 */
|
/* 插入节点 */
|
||||||
node = insert(16);
|
insert(16);
|
||||||
print("\n插入节点 16 后,二叉树为\n");
|
print("\n插入节点 16 后,二叉树为\n");
|
||||||
printTree(getRoot());
|
printTree(getRoot());
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue