Question: def special _ tree ( values, k ) : ####### DO NOT MODIFY THE CODE BELOW ####### myTree = MySpecialTree ( values ) soln =
def specialtree values, k :
####### DO NOT MODIFY THE CODE BELOW #######
myTree MySpecialTreevalues
soln
for val in rangek:
soln.appendmyTreepopmaxvalue
return soln
####### DO NOT MODIFY THE CODE ABOVE #######
class MySpecialTree:
def initself valuesNone:
self.data values or
for x in rangelenvalues:
self.maxtreeifyx
def parentself x:
return x
def leftchildself x:
return x
def rightchildself x:
return x
def maxtreeifyself x:
pass
def popmaxvalueself:
pass
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
