I would like to find the most efficent way to check the node with minimum value in a Binary Search Tree. I'm not thinking to do it in a certain programming language right now, I would like just to think the most efficent algorithm.
What do you think about this:
procedure minBST(t)
if (t = NULL) then return;
if (t -> left = NULL) then return t -> inf;
*// if the left node is null, then in a BST the smallest value will be the root*
if (t -> left != NULL) then ....
*// I need to dig more in the left side until I get the last left node*
My question is how should I dig deeper until I get the last left node. Also I tried to explain the steps. Do you think that is the best way to do it?