code/data_structures/src/stack/infix_to_prefix/README.md
Polish notation (PN), also known as Normal Polish notation (NPN), Łukasiewicz notation, Warsaw notation, Polish prefix notation or simply prefix notation, is a mathematical notation in which operators precede their operands, in contrast to the more common infix notation, in which operators are placed between operands, as well as reverse Polish notation (RPN), in which operators follow their operands.
Prefix and Postfix notations are applied by computers while solving an expression, by converting that expression into either of those forms.
At first infix expression is reversed. Note that for reversing the opening and closing parenthesis will also be reversed.
for an example: The expression: A + B * (C - D)
after reversing the expression will be: ) D – C ( * B + A
so we need to convert opening parenthesis to closing parenthesis and vice versa.
After reversing, the expression is converted to postfix form by using infix to postfix algorithm. After that again the postfix expression is reversed to get the prefix expression.