Skip to content

Instantly share code, notes, and snippets.

@gtke
Created January 28, 2013 19:49
Show Gist options
  • Select an option

  • Save gtke/4658444 to your computer and use it in GitHub Desktop.

Select an option

Save gtke/4658444 to your computer and use it in GitHub Desktop.
BST Contains
/**
* 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