You are viewing a single comment's thread. Return to all comments →
def height(root, prev=0): return max(height(root.left), height(root.right))+1 if root is not None and (root.left is not None or root.right is not None) else prev `
Seems like cookies are disabled on this browser, please enable them to open this website
Tree: Height of a Binary Tree
You are viewing a single comment's thread. Return to all comments →