Sample Python Code For 3rd Sem
Sample Python Code For 3rd Sem
Sample Python Code For 3rd Sem
h>
#include <stdio.h>
#include <stdlib.h>
#define MAX 20
char stk[20];
int top = -1;
int isEmpty()
{
return top == -1;
}
int isFull()
{
return top == MAX - 1;
}
char peek()
{
return stk[top];
}
char pop()
{
if(isEmpty())
return -1;
char ch = stk[top];
top--;
return(ch);
}
else{
top++;
stk[top] = oper;
}
}
case '*':
case '/':
return 2;
case '^':
return 3;
}
return -1;
}
while (!isEmpty())
expression[++j] = pop();
expression[++j] = '\0';
printf( "%s", expression);
}
int main()
{
char expression[] = "((x+(y*z))-w)";
covertInfixToPostfix(expression);
return 0;
}