mirror of
https://github.com/krahets/hello-algo.git
synced 2026-08-21 07:47:14 +00:00
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:
@@ -33,7 +33,7 @@ func preOrder(root: TreeNode?) {
|
||||
enum PreorderTraversalIIICompact {
|
||||
/* Driver Code */
|
||||
static func main() {
|
||||
let root = TreeNode.listToTree(list: [1, 7, 3, 4, 5, 6, 7])
|
||||
let root = TreeNode.listToTree(arr: [1, 7, 3, 4, 5, 6, 7])
|
||||
print("\n初始化二叉树")
|
||||
PrintUtil.printTree(root: root)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user