mirror of
https://github.com/TheAlgorithms/C.git
synced 2026-04-29 00:39:36 +00:00
[PR #910] Stack to carry out infix to postfix conversion. #1442
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Original Pull Request: https://github.com/TheAlgorithms/C/pull/910
State: closed
Merged: No
Implementation of stack to carry out infix to postfix conversion.
Theory:
The Polish Mathematician Han Lukasiewicz suggested a notation called Polish
notation, which gives two alternatives to represent an arithmetic expression,
namely the postfix and prefix notations. In postfix notation, the operator is written
after the two operands. The advantage of the postfix notation (also called reverse
polish notation) are:
prefix notations.
priority and associativity.
Algorithm to convert infix expression to postfix:
3.1 If the ICP>ISP or the stack is empty, push it.
3.2 Else, pop the operator from the stack until ICP<=ISP. Push the scanned
operator to the stack.
encountered.
Description of Change
Implementation of stack to carry out infix to postfix conversion.
References
Checklist
Notes:
Implementation of stack to carry out infix to postfix conversion.