the problem is we shouldnt use any tree traversals
def fill_balance(root):
if root == None : return None root.value = fill_balance(root.left)-fill_balance(root.right)
here is my code to calculate balance of each node of a tee whose root is given .. how can i fix my code ? the solution must be in a single pass root is generated and function must be recursive .