Created
April 12, 2021 16:31
-
-
Save ButlerFuqua/934b7b1f6bcf897409a7d5759e7503d1 to your computer and use it in GitHub Desktop.
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
BSTSearch(tree, key) { | |
cur = tree->root | |
while (cur is not null) | |
if (key == cur->key) | |
return cur // Found | |
else if (key < cur->key) | |
cur = cur->left | |
else | |
cur = cur->right | |
return null // Not found | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment