Fix a comment in binary_search_tree code

This commit is contained in:
krahets
2023-05-17 19:04:46 +08:00
parent 26cc480ff5
commit 817b4598d5
10 changed files with 10 additions and 10 deletions

View File

@ -71,7 +71,7 @@ function insert(num: number): void {
cur = cur.left as TreeNode; // 插入位置在 cur 的左子树中
}
}
// 插入节点 val
// 插入节点
let node = new TreeNode(num);
if (pre!.val < num) {
pre!.right = node;