Created
September 8, 2017 01:31
-
-
Save scriptonian/f20a03e4cfde192233f643a0c02c549c 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
BinarySearchTree.prototype = { | |
/* | |
other code here | |
*/ | |
inOrder: function(node){ | |
if (node !== null) { | |
//print the left subtree recursively | |
this.inOrder(node.left); | |
//print the root node | |
console.log(node.toString()); | |
//print the right subtree recursively | |
this.inOrder(node.right); | |
} | |
} | |
/* | |
other code htere | |
*/ | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment