Skip to content

Instantly share code, notes, and snippets.

@scriptonian
Created September 8, 2017 01:31
Show Gist options
  • Save scriptonian/f20a03e4cfde192233f643a0c02c549c to your computer and use it in GitHub Desktop.
Save scriptonian/f20a03e4cfde192233f643a0c02c549c to your computer and use it in GitHub Desktop.
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