Created
June 29, 2018 12:45
-
-
Save boxgames1/eaf00f5040b3b8cec8f865db697358bc to your computer and use it in GitHub Desktop.
BinaryTreeFind
This file contains 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
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