python program to find the height of the binary tree. code example
Example: find height of binary search tree python
def getHeight(self,root):
return -1 if root is None else 1 + max(self.getHeight(root.left), self.getHeight(root.right))
def getHeight(self,root):
return -1 if root is None else 1 + max(self.getHeight(root.left), self.getHeight(root.right))