mirror of
https://github.com/TheAlgorithms/C.git
synced 2026-02-04 05:44:35 +00:00
[PR #910] [CLOSED] Stack to carry out infix to postfix conversion. #1439
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?
📋 Pull Request Information
Original PR: https://github.com/TheAlgorithms/C/pull/910
Author: @shrijalshr
Created: 10/31/2021
Status: ❌ Closed
Base:
master← Head:patch-1📝 Commits (1)
35c2457Stack to carry out infix to postfix conversion.📊 Changes
1 file changed (+105 additions, -0 deletions)
View changed files
➕
data_structures/stack/infix_postfix_conversion.c(+105 -0)📄 Description
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.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.