LeetCode 783: Minimum Distance Between BST Nodes
Problem Restatement We are given the root of a binary search tree. We need to return the minimum difference between the values of any two different nodes. Because the tree is a BST, an inorder traversal visits the node values in sorted order. So instead of comparing every pair of nodes, we only need to compare neighboring values in inorder order. Input and Output Item Meaning Input Root of a...