Last active
August 29, 2015 14:06
-
-
Save egraldlo/d95f99859c15ac7d4bc1 to your computer and use it in GitHub Desktop.
find_deep
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
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