```
def getMinimumDifference(self, root):
self.previous = self.minimum = float('inf')
def inorder(node):
if node:
inorder(node.left)
self.minimum = min(self.minimum, abs(node.val-self.previous))
self.previous = node.val
inorder(node.right)
inorder(root)
return self.minimum
```