|
Algorithms_in_C 1.0.0
Set of algorithms implemented in C.
|
Infix to Postfix Expression Conversion More...
#include <stdio.h>Data Structures | |
| struct | Stack |
| for printf() and scanf() More... | |
Functions | |
| void | push (struct Stack *p, char x) |
| push function | |
| char | pop (struct Stack *p) |
| pop function | |
| int | isOprnd (char ch) |
| isOprnd function | |
| int | isEmpty (struct Stack s) |
| isEmpty function | |
| int | getPrecedence (char op1, char op2) |
| getPrecedence function returns the precedence after comparing two operators passed as parameter. | |
| void | convert (char infix[], char postfix[]) |
| convert function | |
| int | main () |
| main function | |
Infix to Postfix Expression Conversion
Convert Infixed expressions to Postfix expression.
| void convert | ( | char | infix[], |
| char | postfix[] | ||
| ) |
convert function
| infix[] | : infix array provided by user |
| postfix[] | : empty array to be given to convert() |
| int getPrecedence | ( | char | op1, |
| char | op2 | ||
| ) |
getPrecedence function returns the precedence after comparing two operators passed as parameter.
| op1 | : first operator |
| op2 | : second operator |
| int isEmpty | ( | struct Stack | s | ) |
isEmpty function
| s | : it is the object reference of stack |
| int isOprnd | ( | char | ch | ) |
isOprnd function
| ch | : this is the element from the infix array |
| int main | ( | void | ) |
main function
| int pop | ( | struct Stack * | p | ) |
pop function
| *p | : used as a pointer variable of stack |
| void push | ( | struct Stack * | p, |
| char | x | ||
| ) |
push function
| *p | : used as a pointer variable of stack |
| x | : char to be pushed in stack |