postfix

5 Comments

C++ program to evaluate an expression entered in postfix form

#include <iostream.h> #include <stdlib.h> #include <math.h> #include <ctype.h> const int MAX = 50 ; class postfix { private :   int stack[MAX] ; int top, nn ; char *s ; public : postfix( ) ; void setexpr ( char *str ) ; void push ( int item ) ; int pop( ) ; void calculate( […]

10 Comments

C++ program to convert an Expression from Infix expression to Prefix form

#include <iostream.h> #include <string.h> #include <ctype.h> const int MAX = 50 ; class infix { private : char target[MAX], stack[MAX] ; char *s, *t ; int top, l ; public : infix( ) ; void setexpr ( char *str ) ; void push ( char c ) ; char pop( ) ; void convert( ) […]

11 Comments

C++ program to convert an Expression from Infix form to Postfix form

#include <iostream.h> #include <string.h> #include <ctype.h> const int MAX = 50 ; class infix { private : char target[MAX], stack[MAX] ; char *s, *t ; int top ; public : infix( ) ; void setexpr ( char *str ) ; void push ( char c ) ; char pop( ) ; void convert( ) ; […]