Help me to show step by step solution infix to postfix - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Help me to show step by step solution infix to postfix

the code is running but my professor told me to modify the code. he need to see the step by step conversion of infix to postfix. the problem is i don't know how to show the step by step conversion..
example:
(a+b )/(a-b )
a+b / a-b
a+b a-b/
ab+ ab-/


[code]#include
#define STACK_SIZE 100
using namespace std;

char stackChar[STACK_SIZE];
int top=-1;

void push(char c);
char pop();

int main()
{


char expr[STACK_SIZE], postfixexpr[STACK_SIZE];
cout << "Enter the exp<b>ression: ";
cin.getline(expr,STACK_SIZE);

strcat(expr,")");
push('(');

int j=0;

for(int i=0;i0");
return 0;

}


void push(char c)
{
stackChar[++top] = c;
}

char pop()
{
return stackChar[top--];
}
[/code]
Sign In or Register to comment.