Infix to postfix best algorithm Code: #include<stdio.h> #include<conio.h> int priority(char); void main() { int i=0,j=0,len,sp=0,p1,p; char infix[50],postfix[50],oprstack[45]; clrscr(); printf("enter the infix expression\n"); scanf("%s",infix); len=strlen(infix); oprstack[sp]='('; infix[len]=')'; infix[len+1]='\0'; printf("%s",infix); while(infix[i]!='\0') { if(isdigit(infix[i]) || isalpha(infix[i])) postfix[j++]=infix[i]; else if(infix[i]=='(') { sp++; oprstack[sp]=infix[i]; } else if(infix[i]==')') { while(oprstack[sp]!='(') { postfix[j++]=oprstack[sp]; sp--; } sp--; } else while(1) { p=priority(infix[i]); p1=priority(oprstack[sp]); if(p<=p1 && oprstack[sp]!='(') { postfix[j++]=oprstack[sp]; sp--; } else { sp++; oprstack[sp]=infix[i]; break; } } i++; } postfix[j]=0; printf("\nthe postfix expression is %s",postfix); getch(); } int priority(char ch) { int k; if(ch=='+' || ch=='-' ) k=1; else if(ch=='*' || ch=='/' ) k=2; else k=0; return k; } undefined