Question: IT IS PYTHON LANGUAGE def maximum(self: Tree) -> int: 'Return the maximum item stored in this tree. Return if this tree is empty precondition atl
IT IS PYTHON LANGUAGE
def maximum(self: Tree) -> int: '""Return the maximum item stored in this tree. Return if this tree is empty precondition atl vatues in this tre are positive integers >>> t1 = Tree(17, [1) >> t1.maximum() 17 >t3 Tree(1, [Tree(-2, [), Tree (10, [1), Tree(-30, [1)]) >>> t3.maximum() 10 # if self.is.empty(): # elif self-subtrees-D- # else: # for subtree in self._subtrees: subtree.maximum() pass
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
