|
| 1 | +<h2><a href="https://leetcode.com/problems/minimum-distance-between-bst-nodes/">783. Minimum Distance Between BST Nodes</a></h2><h3>Easy</h3><hr><div><p>Given the <code>root</code> of a Binary Search Tree (BST), return <em>the minimum difference between the values of any two different nodes in the tree</em>.</p> |
| 2 | + |
| 3 | +<p> </p> |
| 4 | +<p><strong class="example">Example 1:</strong></p> |
| 5 | +<img alt="" src="https://assets.leetcode.com/uploads/2021/02/05/bst1.jpg" style="width: 292px; height: 301px;"> |
| 6 | +<pre><strong>Input:</strong> root = [4,2,6,1,3] |
| 7 | +<strong>Output:</strong> 1 |
| 8 | +</pre> |
| 9 | + |
| 10 | +<p><strong class="example">Example 2:</strong></p> |
| 11 | +<img alt="" src="https://assets.leetcode.com/uploads/2021/02/05/bst2.jpg" style="width: 282px; height: 301px;"> |
| 12 | +<pre><strong>Input:</strong> root = [1,0,48,null,null,12,49] |
| 13 | +<strong>Output:</strong> 1 |
| 14 | +</pre> |
| 15 | + |
| 16 | +<p> </p> |
| 17 | +<p><strong>Constraints:</strong></p> |
| 18 | + |
| 19 | +<ul> |
| 20 | + <li>The number of nodes in the tree is in the range <code>[2, 100]</code>.</li> |
| 21 | + <li><code>0 <= Node.val <= 10<sup>5</sup></code></li> |
| 22 | +</ul> |
| 23 | + |
| 24 | +<p> </p> |
| 25 | +<p><strong>Note:</strong> This question is the same as 530: <a href="https://leetcode.com/problems/minimum-absolute-difference-in-bst/" target="_blank">https://leetcode.com/problems/minimum-absolute-difference-in-bst/</a></p> |
| 26 | +</div> |
0 commit comments