mirror of
https://github.com/krahets/hello-algo.git
synced 2026-08-20 23:41:00 +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:
@@ -25,7 +25,7 @@ func preOrder(root: TreeNode?) {
|
||||
enum PreorderTraversalICompact {
|
||||
/* 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