```
class Solution(object):
def it(self, root):
if not root:
raise StopIteration
for val in self.it(root.left):
yield val
yield root.val
for val in self.it(root.right):
yield val
def getMinimumDifference(self, root):
lst = list(self.it(root))
return min(map(lambda p:abs(p[0] - p[1]), zip(lst, lst[1:])))
```