Skip to content

Instantly share code, notes, and snippets.

@boxgames1
Created June 29, 2018 12:45
Show Gist options
  • Save boxgames1/eaf00f5040b3b8cec8f865db697358bc to your computer and use it in GitHub Desktop.
Save boxgames1/eaf00f5040b3b8cec8f865db697358bc to your computer and use it in GitHub Desktop.
BinaryTreeFind
find(node, key) {
if (node === null) return null;
else if (key < node.key) return this.find(node.left, key);
else if (key > node.key) return this.find(node.right, key);
else return node;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment