fix binary_search_tree code

This commit is contained in:
krahets
2023-08-31 02:31:31 +08:00
parent f7ab4797bf
commit 628d8a516b
14 changed files with 195 additions and 227 deletions

View File

@@ -58,8 +58,9 @@ class BinarySearchTree {
/* */
func insert(num: Int) {
//
//
if root == nil {
root = TreeNode(x: num)
return
}
var cur = root