algo_054
Problem Statement
Problem Statement
Write a non-recursive algorithm to find the minimum element from a Binary Search Tree (BST).
Algorithm
procedure findMin(T)
begin
ptr ← T;
if (ptr = NULL) then
return -1;
else
while (LC(ptr) ≠ NULL) do
ptr ← LC(ptr);
endwhile
return INFO(ptr);
endif
end procedure1
2
3
4
5
6
7
8
9
10
11
12
2
3
4
5
6
7
8
9
10
11
12