Tree: Height of a Binary Tree

  • + 0 comments
    def height(curr_node, level=-1):
        if curr_node is None:
            return level
            
        return max(height(curr_node.left, level + 1), height(curr_node.right, level + 1))
    

    `