bsc

Comprehensive codebase and coursework for the 4-year B.Sc. Computer Science Honours degree (WBSU)

git clone https://github.com/notamitgamer/bsc.git
· rebuilt hourlyOpen on GitHub
root / semester_2 / algorithms / algo_054.md

algo_054.md (379B)


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