/************************************************************
* Filename: postfix_evaluation.c
* Description: postfix evaluation using stack
* Author:Sarju S
* Date: 02-Dec-2011
*************************************************************/
#include
#include
#define MAX_EXPR_SIZE 100
#define MAX_STACK_SIZE 100
typedef enum {eos,lparen, rparen, plus, minus, times, divide,mod,operand} precedence;
char postfixExpr[MAX_EXPR_SIZE];
int stack[MAX_STACK_SIZE];
int...
Thursday, December 1, 2011
Infix to Postfix conversion using stack
/************************************************************
* Filename: infix_to_postfix.c
* Description: infix to postfix conversion using stack
* Author:Sarju S
* Date: 01-Dec-2011
*************************************************************/
#include
#include
#define MAX_EXPR_SIZE 100
#define MAX_STACK_SIZE 100
typedef enum {eos,lparen, rparen, plus, minus, times, divide,mod,operand} precedence;
char infixExpr[MAX_EXPR_SIZE],postfixExpr[MAX_EXPR_SIZE];
precedence...