Question: Problem: Take an arithmetic expression in infix notation, I. a. Write a function In_Post(I) to covert I to it's postfix notation(reverse-polish notation), P. b. Then
Problem: Take an arithmetic expression in infix notation, I. a. Write a function In_Post(I) to covert I to
it's postfix notation(reverse-polish notation), P. b. Then write another function to evaluate the value of P and print the result. Example: a. Input: 9-(8/2^2+1)*3 Output : 9822^/1+3*- b. Input: 9822^/1+3*- Output: 0
def In_Post(I): input = def Eval_Post(P) # take the postfix expression as input in P # evaluate and print the result def infixToPostfix(infixexpr) prec prec["A"] - 4 prec [" * "] = 3
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
