Thread: Evaluate postfix expression program

  1. #1
    Registered User
    Join Date
    Dec 2001

    Unhappy Evaluate postfix expression program

    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??

  2. #2
    of Zen Hall zen's Avatar
    Join Date
    Aug 2001
    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.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 17
    Last Post: 10-06-2008, 07:54 PM
  2. evaluate postfix expressions read from infile
    By killmequick in forum C Programming
    Replies: 5
    Last Post: 10-02-2008, 01:19 PM
  3. Need help with my program...
    By Noah in forum C Programming
    Replies: 2
    Last Post: 03-11-2006, 07:49 PM
  4. I need some help with my program please.
    By agentxx04 in forum C Programming
    Replies: 9
    Last Post: 09-26-2004, 07:51 AM
  5. My program, anyhelp
    By @licomb in forum C Programming
    Replies: 14
    Last Post: 08-14-2001, 10:04 PM