Infix expression : a + b - c *d / e
if we apply infix to post-fix algorithm on it the a/c to this algorithm
Operator should get into the stack not Operand
Inside Stack only Higher Priority operator can sit on Lower Priority Operator
if Higher Priority Operator is already in the stack then we first Pop-off the Higher Priority Operator from stack and the push the Lower priority Operator.
if we get any operand in expression we just keep writing them a/c to the above rules.
first step is see expression a + b - c *d / e
we first got a we don't do anything with it because it is a operand just write it down separate a
then we got + and initially stack is empty so push it on to the stack
then we got b don't do anything just write it down as it is b
Total postfix Expression till now ab
then we got "-" a/c to precedence both have same precedence but a/c to associativity they are Left associative means + has higher priority here and as i said Lower Priority operator can't sit on higher priority operator so we have to pop off the "+" from stack and write it down with ab it will be ab+ now stack is empty and we can push " - " now onto the stack.
then we got c don't do anything with it write it down as it is c
then we got "*" which has higher precedence then "-" so it can sit on it.
then we got d don't do anything with it write it down as it is d
Total postfix Expression till now ab+cd
now we got "/" which has same precedence as "*" has now we look at associativity in which "*" won because they have Left to right .so lower associativity operator can'f sit on at higher one so pop off expression would be ab+cd*
then we got e don't do anything with it write it down as it is e
Total Postfix Expression till now ab+cd*e
in stack we got / and - so pop off and get the final postfix expression
Final postfix Expression ab+cd*e/-
This is how Algorithm works but you can compute it without this algorithm as well.