Skip to content

Instantly share code, notes, and snippets.

@reyou
Created May 24, 2018 02:20
Show Gist options
  • Save reyou/9e75a7d804a53ae8600c86a1e070daba to your computer and use it in GitHub Desktop.
Save reyou/9e75a7d804a53ae8600c86a1e070daba to your computer and use it in GitHub Desktop.
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