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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started