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:

Tupling help needed. I have function like this: The target of 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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!