1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

data structure

Discussion in 'C++' started by shadowkaizer18, Jan 12, 2011.

  1. shadowkaizer18

    shadowkaizer18 New Member

    Joined:
    Jan 12, 2011
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    0
    Location:
    Philippines
    can someone help me with the codes for stacks for prefix! badly needed...
     
  2. imported_Isa

    imported_Isa New Member

    Joined:
    Sep 1, 2010
    Messages:
    24
    Likes Received:
    0
    Trophy Points:
    0
    Occupation:
    Bachelor
    Location:
    shahi(search in fb)
    you most use 2 stacks for this. one time push them in stack like postfix, then pop all symble.
     
  3. 7900142

    7900142 New Member

    Joined:
    Jan 12, 2011
    Messages:
    14
    Likes Received:
    0
    Trophy Points:
    0
    Occupation:
    Free lance software developer, an instructor and a
    Location:
    Philippines
    Hey,
    Are you trying to convert an Infix notation to Prefix notation? Well, if that will be the case then, you must consider the priority of each element that will be involved in the stack simulation. I think you must also consider the precedence of each operator while pushing and/or pop'n elements from the stack. So, if you can actually get my point, well you will be needing 2 stacks...1 for the input and the other for the temporary storage.....

    regards
    7900142
     

Share This Page