algo_056.md (379B)
1 # algo_056 2 3 ### Problem Statement 4 5 > Write a non-recursive algorithm to find the maximum element from a Binary Search Tree (BST). 6 7 ## Algorithm 8 ``` 9 procedure findMax(T) 10 begin 11 ptr ← T; 12 if (ptr = NULL) then 13 return -1; 14 else 15 while (RC(ptr) ≠ NULL) do 16 ptr ← RC(ptr); 17 endwhile 18 return INFO(ptr); 19 endif 20 end procedure 21 ```