Thread: From postfix to infix

  1. #1
    Registered User
    Join Date
    Nov 2001

    From postfix to infix

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


  2. #2
    Registered User jasrajva's Avatar
    Join Date
    Oct 2001
    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

                                 /   \
                                /     \
                               /       \
                             +         +
                            /  \       /  \
                           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, 07: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, 02:17 PM
  4. Converting from infix to postfix
    By jcramer in forum C Programming
    Replies: 4
    Last Post: 03-27-2004, 09:23 PM
  5. Infix to Postfix
    By dat in forum C Programming
    Replies: 6
    Last Post: 06-16-2003, 08:46 AM