Question: void infixToPostfix ( char * infix, char * postfix ) { int i , j; int top = - 1 ; char stack [ Max

void infixToPostfix(char* infix, char* postfix){ int i, j; int top =-1; char stack[Max_Length]; for (i =0, j =0; infix[i]!='\0'; i++){ if (isOperand(infix[i])){ postfix[j++]= infix[i]; } else if (infix[i]=='('){ stack[++top]= infix[i]; } else if (infix[i]==')'){ while (top !=-1 && stack[top]!='('){ postfix[j++]= stack[top--]; } top--; // Pop '(' from the stack } else { while (top !=-1 && precedence(infix[i])<= precedence(stack[top])){ postfix[j++]= stack[top--]; } stack[++top]= infix[i]; }} while (top !=-1){ postfix[j++]= stack[top--]; } postfix[j]='\0';}
I want you to modify that i can change from infix to postifx corrctly

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!