Created
May 24, 2018 02:20
-
-
Save reyou/9e75a7d804a53ae8600c86a1e070daba to your computer and use it in GitHub Desktop.
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
struct BstNode | |
{ | |
int data; | |
BstNode *left; | |
BstNode *right; | |
}; | |
int FindMin(BstNode *root) | |
{ | |
if (root == NULL) | |
{ | |
cout << "Error: Tree is empty\n"; | |
return -1; | |
} | |
BstNode *current = root; | |
while (current->left != NULL) | |
{ | |
current = current->left; | |
} | |
return root->data; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment