Given infix expression are$:2 + 3 - ( 6 * 7 ) $
now convert infix to postfix expression using operator stack, we get postfix expression$: 2 3 + 6 7 * - $ [Because, if associativity not given we take $'+' $ are left associative]
now postfix expression$: 2 3 + 6 7 * - $
Scan entire string from left to right, when any operator come, pop top two elements and perform an operation (let say result = pop2$+$po1) and then push back result into the stack. Repeat this step until string scanning is over.
![](https://gateoverflow.in/?qa=blob&qa_blobid=15913736429473525980)
![](https://gateoverflow.in/?qa=blob&qa_blobid=11745453901694424182)
![](https://gateoverflow.in/?qa=blob&qa_blobid=546583999881942153)
So,i got $(3)$ are stack configuration.
and if we take $'+'$ is right associative,then postfix expression are$: 2 3 6 7 * - + $
![](https://gateoverflow.in/?qa=blob&qa_blobid=13869586115401984392)
![](https://gateoverflow.in/?qa=blob&qa_blobid=3348599423868980459)
![](https://gateoverflow.in/?qa=blob&qa_blobid=3545522142946792560)
So, I got $(2)$ are stack configuration.