Question: Question: Implement Gui of the following given code the code run in gui and attach output of gui code. Language python. import math def fun_Minmax(cd,
Question:
Implement Gui of the following given code the code run in gui and attach output of gui code.
Language python.
import math
def fun_Minmax(cd, node, maxt, scr, td): if(cd==td): return scr[node] if(maxt): return max(fun_Minmax(cd+1, node*2, False, scr, td), fun_Minmax(cd+1, node*2+1, False, scr, td)) else: return min(fun_Minmax(cd+1, node*2, True, scr, td), fun_Minmax(cd+1, node*2+1, True, scr, td))
scr=[] x=int(input("Enter total number of leaf node=")) for i in range(x): y=int(input("Enter leaf value:")) scr.append(y) td=math.log(len(scr),2) cd=int(input("Enter current depth value:")) nodev=int(input("Enter node value:")) maxt=True
print("The answer is:",end=" ") answer=fun_Minmax(cd, nodev, maxt, scr, td) print(answer)
Note: Code this simple python code in gui of python. and attach output
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
