Evaluate postfix expression program

This is a discussion on Evaluate postfix expression program within the C Programming forums, part of the General Programming Boards category; how do i write a program to evalute postfix expression? what method should i use? please help..i'm dying right here ...

  1. #1
    Registered User
    Join Date
    Dec 2001
    Posts
    5

    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
    zen
    zen is offline
    of Zen Hall zen's Avatar
    Join Date
    Aug 2001
    Posts
    1,007
    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

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 17
    Last Post: 10-06-2008, 08:54 PM
  2. evaluate postfix expressions read from infile
    By killmequick in forum C Programming
    Replies: 5
    Last Post: 10-02-2008, 02: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, 08:51 AM
  5. My program, anyhelp
    By @licomb in forum C Programming
    Replies: 14
    Last Post: 08-14-2001, 11:04 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21