# binary search trees – Minimum absolute difference in a BST is always between

Your proof for case 1 seems like good intuition (it is not a formal proof). However, instead of the proof in case 2, you can directly reduce case 2 to case 1:

Lets say that the minimal value in the tree is $$v_{min}inmathbb{R}$$. Then, we can artificially “add” $$v_{min}$$ to the value of every node in the BST. Now, the BST will contain only non-negative numbers. This BST will follow case 1.

I claim, that for any two nodes with values $$v’_1$$, $$v’_2$$ in this updated BST, their absolute difference is the same as their absolute difference from the original BST, that had values $$v_1,v_2$$ in them:

$$|v’_2-v’_1|=|v_2+v_{min}-(v_1+v_{min})|=|v_2-v_1+v_{min}-v_{min}|=|v_2-v_1|$$

And hence the proof for case 1 works here as well.