Deleting smallest node in binary search tree 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
http://osprey.unisa.ac.za/phorum/read.php?23,42900,42900#msg-42900
Sat, 20 Apr 2019 11:19:15 +0200Phorum 5.2.18http://osprey.unisa.ac.za/phorum/read.php?23,42900,43081#msg-43081Re: Deleting smallest node in binary search tree
http://osprey.unisa.ac.za/phorum/read.php?23,42900,43081#msg-43081
robanaurochsCOS211XTue, 03 Oct 2006 08:57:22 +0200http://osprey.unisa.ac.za/phorum/read.php?23,42900,42900#msg-42900Deleting smallest node in binary search tree
http://osprey.unisa.ac.za/phorum/read.php?23,42900,42900#msg-42900
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?