Created
April 9, 2019 09:45
-
-
Save ssaurel/f7eaad4ad40a11f20b5cdd42edc4a188 to your computer and use it in GitHub Desktop.
Pre Order Traversal implementation on the SSaurel's Channel
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
// Root, Left, Right | |
public static <T> void preOrderTraverse(Node<T> node) { | |
if (node == null) | |
return; | |
System.out.print(node.data + " "); | |
preOrderTraverse(node.left); | |
preOrderTraverse(node.right); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment