I don't understand how this isn't working:
Node* BST::Minimum(Node *curr) {
if (curr->left != NULL) {
Minimum(curr->left);
}
return curr;
}
I mean I already did insert fine, and printpostorder, inorderr, preorder fine.
Am I doing something silly? This just prints the root node.
You call Minimum
and throw its return value away. You want return Minimum(curr->left);
.
By the way, I strongly recommend doing this iteratively rather than recursively, like this:
Node* node = curr;
while (node->left != NULL)
node = node->left;
return node;