30. Minimum element in BST
My Approach
Time and Auxiliary Space Complexity
Code (C++)
class Solution {
public:
int minValue(Node* root)
{
if (!root)
return -1;
if (root->left)
{
root=root->left;
minValue(root);
}
else return root->data;
}
};Contribution and Support
Last updated