Hi guys
This was a question in assignment 04. According to the solutions, you basically traverse to the leftmost node and that will be the smallest node in the BST. I am not entirely convinced that this efficient. Here's my argument:
1. Assume you have an initially empty BST.
2. Now assume that you enter the following values in order:
x[1]; x[2]; ...; x[n]
and let x[1] be the smallest element in the list of values.
Because the BST is initially empty, when x[1] is entered, it becomes the root of the BST and x[2]...x[n] follow the normal conditions. But if we traverse to the leftmost node now- we dont get the smallest value because the root is the smallest value. Am I missing something somewhere or is my logic sound?
Regards