data_structures.stacks.postfix_to_infix_conversion ================================================== .. py:module:: data_structures.stacks.postfix_to_infix_conversion .. autoapi-nested-parse:: https://math.oxford.emory.edu/site/cs171/postfixExpressions/ https://en.wikipedia.org/wiki/Shunting_yard_algorithm Attributes ---------- .. autoapisummary:: data_structures.stacks.postfix_to_infix_conversion.postfix_expression Functions --------- .. autoapisummary:: data_structures.stacks.postfix_to_infix_conversion.postfix_to_infix Module Contents --------------- .. py:function:: 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)' .. py:data:: postfix_expression :value: '512+4*+3-'