Sunday, July 12, 2009

Write a program in c language to evaluate a postfix expression by using a stack illustrate the algorithm with?

c language

Write a program in c language to evaluate a postfix expression by using a stack illustrate the algorithm with?
To evaluate a postfix expression, what you'll do is push every value onto the stack until you reach an operator, once you've reached an operator pop the last two values off the stack, run that operation on them and push the result back onto the stack.





In the end you'll only have one value on the stack which is the answer.


No comments:

Post a Comment