Minimum Distance Between BST Nodes
PreviousPrint common nodes on path from root (or common ancestors)NextFind distance between two nodes of a Binary Tree
Last updated
Last updated
Given a Binary Search Tree (BST) with the root node root
, return the minimum difference between the values of any two different nodes in the tree.
Example :
Note:
The size of the BST will be between 2 and 100
.
The BST is always valid, each node's value is an integer, and each node's value is different.
This question is the same as 530: