Skip to content

Instantly share code, notes, and snippets.

@egraldlo
Last active August 29, 2015 14:06
Show Gist options
  • Save egraldlo/d95f99859c15ac7d4bc1 to your computer and use it in GitHub Desktop.
Save egraldlo/d95f99859c15ac7d4bc1 to your computer and use it in GitHub Desktop.
find_deep
template <typename Value>
int BStree<Value>::
deep(node<Value> *root,Value target){
if(root->value==target) {
return 1;
}
else {
if(root->left!=0) {
return (1+deep(root->left,target));
}
if(root->right!=0) {
return (1+deep(root->right,target));
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment