Last active
November 13, 2021 13:28
-
-
Save MauricioRobayo/630ff1b5639faff4401b1c50ea8a7a33 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
function inOrder(node) { | |
node.left && this.inOrder(node.left); | |
console.log(node.val); | |
node.right && this.inOrder(node.right); | |
} |
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
function postOrder(node) { | |
node.left && this.postOrder(node.left); | |
node.right && this.postOrder(node.right); | |
console.log(node.val); | |
} |
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
function preOrder(node) { | |
console.log(node.val); | |
node.left && this.preOrder(node.left); | |
node.right && this.preOrder(node.right); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment