CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    Nov 2011
    Posts
    38

    Infix to Reverse Polish notation

    I have to convert..

    X=A+((B+C)*D)-E

    to reverse polish notation

    I think it's...

    BC+D*A+E-

    Is this correct?

  2. #2
    Join Date
    Jun 2010
    Location
    Germany
    Posts
    2,675

    Re: Infix to Reverse Polish notation

    Yes.

    However, it's probably tricky to implement that in assembly language without even knowing for what platform...
    I was thrown out of college for cheating on the metaphysics exam; I looked into the soul of the boy sitting next to me.

    This is a snakeskin jacket! And for me it's a symbol of my individuality, and my belief... in personal freedom.

  3. #3
    Join Date
    Nov 2011
    Posts
    38

    Re: Infix to Reverse Polish notation

    Thank you. I also completely do not understand this problem...

    Write a program to evaluate the arithmetic statement using a general register computer with three-operand instructions

    X = A*(B + C) + D / E* F +G

  4. #4
    Join Date
    Jun 2010
    Location
    Germany
    Posts
    2,675

    Re: Infix to Reverse Polish notation

    Quote Originally Posted by halt4814 View Post
    I also completely do not understand this problem...
    Well, the actual problem is quite common and I'd say it's on an intermediate level. I could write a program for it without any notable problems if only I'd know in which concrete language to write it.

    [...] using a general register computer with three-operand instructions
    Now this is a bit more of information about your target platform, yet not enough. Haven't you been given a more detailed description of the hypothetical target platform? Perhaps there's sort of an academic standard hypothetical platform that refers to, but in this case I don't know it, and I didn't find anything on Wikipedia either.
    I was thrown out of college for cheating on the metaphysics exam; I looked into the soul of the boy sitting next to me.

    This is a snakeskin jacket! And for me it's a symbol of my individuality, and my belief... in personal freedom.

Posting Permissions

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





Click Here to Expand Forum to Full Width

Featured