Feature/array representation of tree swift (#649)

* refactor: encode & decode Tree

* style: build warning

* feat: add Swift codes for array_representation_of_tree article
This commit is contained in:
nuomi1
2023-07-24 12:46:48 +08:00
committed by GitHub
parent c1adeb2399
commit 9ab4b0b15c
12 changed files with 200 additions and 32 deletions

View File

@ -90,7 +90,6 @@ class BinarySearchTree {
}
/* */
@discardableResult
func remove(num: Int) {
//
if root == nil {
@ -160,7 +159,7 @@ enum _BinarySearchTree {
PrintUtil.printTree(root: bst.getRoot())
/* */
var node = bst.search(num: 7)
let node = bst.search(num: 7)
print("\n查找到的节点对象为 \(node!),节点值 = \(node!.val)")
/* */