Created
January 28, 2017 13:09
-
-
Save themoah/856959c8c49efbbc8f0a908c13097203 to your computer and use it in GitHub Desktop.
This file contains 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
// pre-order sorting | |
Visit(Node current) { | |
if (current == null){ | |
return; | |
} | |
Process(current.value); | |
Visit(current.Left); | |
Visit(current.Right); | |
} | |
// in-order sorting | |
Visit(Node current){ | |
if (current == null) { | |
return; | |
} | |
Visit(current.Left); | |
Process(current.value); | |
Visit(current.Right); | |
} | |
// post order sorting | |
Visit(Node current){ | |
if (current == null) { | |
return; | |
} | |
Visit(current.Left); | |
Visit(current.Right); | |
Process(current.value); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment