data_structures.stacks.postfix_to_infix_conversion¶
https://math.oxford.emory.edu/site/cs171/postfixExpressions/ https://en.wikipedia.org/wiki/Shunting_yard_algorithm
Attributes¶
Functions¶
|
Returns the infix expression for the given postfix expression as an argument |
Module Contents¶
- data_structures.stacks.postfix_to_infix_conversion.postfix_to_infix(postfix_expression: str) str¶
Returns the infix expression for the given postfix expression as an argument >>> postfix_to_infix(“”) Traceback (most recent call last):
…
ValueError: Invalid postfix expression. >>> postfix_to_infix(“123+*4+”) ‘((1*(2+3))+4)’ >>> postfix_to_infix(“abc*+de*f+g*+”) ‘((a+(b*c))+(((d*e)+f)*g))’ >>> postfix_to_infix(“xy^5z*/2+”) ‘(((x^y)/(5*z))+2)’ >>> postfix_to_infix(“232^^”) ‘(2^(3^2))’ >>> postfix_to_infix(“32+”) ‘(3+2)’
- data_structures.stacks.postfix_to_infix_conversion.postfix_expression = '512+4*+3-'¶