Skip to content

Instantly share code, notes, and snippets.

@KrauserHuang
Created April 14, 2022 10:01
Show Gist options
  • Save KrauserHuang/f14437bc407a68de056038f672d762cb to your computer and use it in GitHub Desktop.
Save KrauserHuang/f14437bc407a68de056038f672d762cb to your computer and use it in GitHub Desktop.
// left | root | right
func inOrderTraverse(_ root: Node?) {
if let root = root {
inOrderTraverse(root.left)
print(root.value, terminator: " ")
inOrderTraverse(root.right)
}
}
inOrderTraverse(node_1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment