Results 1 to 5 of 5

Thread: Postfix this!!

  1. #1
    hasysf is offline Member
    Join Date
    Jul 2008
    Posts
    19
    Rep Power
    0

    Default Postfix this!!

    Hello
    I have been given a expression in infix form i.e

    ("1999 < year & year < 2000");

    I have no clue how to post fix this expression
    Any ideas would be appreciated.
    thanks

  2. #2
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,315
    Blog Entries
    1
    Rep Power
    28

    Default

    I know that this is irrelevant to your question, but your expression as shown appears to be always false. EDIT: this is incorrect. Instead it appears to contain a redundant boolean. Sorry.

    Regarding changing infix to postfix, I've found many fine tutorials online via Google. Have you given that a go yet? If so, what have you found? What have you tried?

    Best of luck.

    Edit: I did another search since it's been a while since I've looked this. On first glance, the Wikipedia article on this looks not bad. Why not give it a look:
    Shunting Yard Algorithm
    Last edited by Fubarable; 09-07-2009 at 06:34 PM.

  3. #3
    hasysf is offline Member
    Join Date
    Jul 2008
    Posts
    19
    Rep Power
    0

    Default

    I have coded till the stack filling out the year and the number,, but i am stuck with the operator precendence thing. I dont no what to do it and how to do it,
    I have search on the net,, but i am confused abt the code..

  4. #4
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,315
    Blog Entries
    1
    Rep Power
    28

    Default

    I'm no pro at this, but there are others here who are... but to better allow them/us to help you, please post what you have so far. So please post your code (with code tags -- see my signature), and if you have any data files, post those too.

    Much luck!

    edit: I've just reviewed the Wikipedia article, and it does in fact address operator precedence. It's all there! :)
    Last edited by Fubarable; 09-07-2009 at 06:31 PM.

  5. #5
    r035198x is offline Senior Member
    Join Date
    Aug 2009
    Posts
    2,388
    Rep Power
    10

Similar Threads

  1. Postfix into prefix and vice versa
    By sfe23 in forum New To Java
    Replies: 9
    Last Post: 02-19-2009, 11:37 PM
  2. Postfix Evaluation using a Stack, Help?
    By dalangley in forum New To Java
    Replies: 2
    Last Post: 02-16-2009, 11:43 PM
  3. Postfix-Notation
    By little_polarbear in forum New To Java
    Replies: 9
    Last Post: 09-09-2008, 04:24 PM
  4. Replies: 0
    Last Post: 04-15-2008, 07:36 PM
  5. How to parse postfix arithmetic expressions
    By Java Tip in forum java.lang
    Replies: 0
    Last Post: 04-15-2008, 07:36 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •