```
def getMinimumDifference(self, root):
min_diff = float('inf')
nodes = self.inorder(root)
prev = nodes.next()
for n in nodes:
min_diff = min(min_diff, n.val - prev.val)
prev = n
return min_diff
def inorder(self, root):
if root:
for n in self.inorder(root.left): yield n
yield root
for n in self.inorder(root.right): yield n
```