Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
tree traversals
// depth first in-order
function traverse(node) {
console.log(node.value);
node.children.forEach(function (child) {
traverse(child);
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment