Question: Tupling help needed. I have function like this: The target of this function is to check if the treenode is complete or not. Hoping it
Tupling help needed.
I have function like this:

The target of this function is to check if the treenode is complete or not.
Hoping it return True,height(int) if tree is complete.
return False,None otherwise
But it report error when I use it.
unsupported operand type(s) for +: 'NoneType' and 'int'
How can I modify this function?
df mptn) if tn is Kone return True, 0 else ldepth= cmp ( treenode. get-left ( tn )) [1] rdepth - emp ( treenode get_right tn if depth-rdepth return True, rdepth +1 else return False, one
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
