Created
January 28, 2013 19:49
-
-
Save gtke/4658444 to your computer and use it in GitHub Desktop.
BST Contains
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
| /** | |
| * Checks if the BST contains a data entry | |
| * | |
| * null is positive infinity | |
| * | |
| * @param data The data entry to be checked | |
| * @return If the data entry is in the BST | |
| */ | |
| public boolean contains(T data) { | |
| if(root == null){ | |
| return false; | |
| }else{ | |
| return search(data, root); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment