From postfix to infix

This is a discussion on From postfix to infix within the C Programming forums, part of the General Programming Boards category; Hello; Do you have any idea how to start if I want to change the Stack postfix operation to Infix ...

  1. #1
    Registered User
    Join Date
    Nov 2001
    Posts
    11

    From postfix to infix

    Hello;
    Do you have any idea how to start if I want to change the Stack postfix operation to Infix operation or prefix operation?????

    Hoping for any ones suggestion?????

    BYE!!!

  2. #2
    Registered User jasrajva's Avatar
    Join Date
    Oct 2001
    Posts
    99
    u can do that by making a tree from the stack contents and then traversing the tree in either inorder or preorder as you wish

    if ab+cd+* is your postfix stack(rightmost being topmost) the tree would be

    Code:
                                   *
                                 /   \
                                /     \
                               /       \
                             +         +
                            /  \       /  \
                           a   b    c    d
    to make the tree you will need to.....wel im not sure rite now what exactly but i'll get back to you in a day
    im sure this cant be too tuf

    another way i can think of is starting from the left and parsing the postfix string......

    sorry my ideas are a little incomplete rite now...

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Expression: Convert infix notation to postfix notation.
    By Nutshell in forum C Programming
    Replies: 7
    Last Post: 02-27-2010, 06:44 AM
  2. Infix, Postfix, Pseudo-Calculator using Stack ADT
    By sangken in forum C Programming
    Replies: 9
    Last Post: 09-08-2006, 08:17 AM
  3. Replies: 4
    Last Post: 03-12-2006, 01:17 PM
  4. Converting from infix to postfix
    By jcramer in forum C Programming
    Replies: 4
    Last Post: 03-27-2004, 08:23 PM
  5. Infix to Postfix
    By dat in forum C Programming
    Replies: 6
    Last Post: 06-16-2003, 08:46 AM

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