algorithms icon indicating copy to clipboard operation
algorithms copied to clipboard

Issue #13 - BST Tree

Open Mohammadjafari80 opened this issue 4 years ago • 0 comments

I looked into the code and actually, there is a tiny problem with it. There is an iteration in the Delete function which keeps traversing the tree until it finds the right place for the desired Node. It's going to return false in case of unavailability of that value but otherwise, it eventually goes into the last case which means the node h and node n have the same values but this doesn't 100 percent guarantee that they are equal in terms of an object so we can't use one instead of the other. Therefore we should change the n to h in line 136. This can actually may cause unwanted modification in some cases.

Mohammadjafari80 avatar Feb 04 '21 12:02 Mohammadjafari80