how do i write a program to evalute postfix expression?
what method should i use?
please help..i'm dying right here trying to figure out the damn thing. My friend said I can use link list to do it.HOW??
how do i write a program to evalute postfix expression?
what method should i use?
please help..i'm dying right here trying to figure out the damn thing. My friend said I can use link list to do it.HOW??
You could use a stack. Evaluate the expression pushing each operand onto the stack. When you get to an operator, pop the required operands off the top of the stack and push the result back. Keep doing this until there is only one operand left and zero operators.
zen