Tree: Height of a Binary Tree

  • + 1 comment

    def height(root): if root is None: return -1 else: lDepth = height(root.left) rDepth = height(root.right) if(lDepth > rDepth): return lDepth + 1 else: return rDepth + 1