Created
April 14, 2022 10:04
-
-
Save KrauserHuang/83e6c832e101c5c26a43036fbf2ce7c5 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// left | right | root | |
func postOrderTraverse(_ root: Node?) { | |
if let root = root { | |
postOrderTraverse(root.left) | |
postOrderTraverse(root.right) | |
print(root.value, terminator: " ") | |
} | |
} | |
postOrderTraverse(node_1) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment