Created
December 4, 2013 01:59
-
-
Save fabslab/c2f99336ea304cc23c54 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
// in-order binary tree traversal, returns array containing each node's value | |
function inOrder(node) { | |
if (node == null) return []; | |
return inOrder(node.left).concat([node.value]).concat(inOrder(node.right)); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment