Link to home
Start Free TrialLog in
Avatar of collegegirl
collegegirl

asked on

question about push and pop and stacks (very URGENT)

Hi,
I have a question about stacks, push, and pop, related to postfix and prefix notation. Say I have a the postfix notation of abc x+ and the reverse Polish prefix of cb x a +. Right now I have the stacks like this:

Prefix             Postfix
c                     +
b                     x
x                     c
a                     b
+                     a

Am I stacking these correctly?  With the pre-fix I'm stack LIFO (I think) and the post-fix FILO (first in last out). Sorry if this is confusing. What I basically want to know is if the stacking method is correct and if there is anything from having both stacks be LIFO or FILO.  Or put another way, how do you know how to stack a problem like this? The infix notation of this is a+ (bxc) if this helps any. I hope this makes some kind of sense. If all is lost hopefully someone can explain stacks to me and push and pop.

Thanks

Angela
ASKER CERTIFIED SOLUTION
Avatar of djwillms
djwillms

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of tomgallo
tomgallo

Yes... Arthur is right.
My example is a LIFO...

Sorry bout that.
-tom
Angela, one of the purposes of this site is to facilitate a DIALOG bewtten teh asker and the answerer(s).  That means that you should say something.  If what we told you was not clear, then you should askl for clarification.  But to NOT SAY ANYTHING, and then accept an answer, and simply grade it a B is not going to go very far in encouraging Experts here, in the future, to offer you any assistance.

Just a simple word of advice.

Glad we could assist you, in what would seem to be ab incomplete manner.

AW
Avatar of collegegirl

ASKER

Hi,
I didn't understand that  a B was a bad grade.... in college it means above average. What does it mean here? Are you supposed to give explaination if you grade below an A? Can you show me where it talks about how to grade questions on this site? I will admit that the answers wasn't clear to me so that's why I didn't give it an A but I didn't think they were bad answers. It didn't occur to me to say something back because I didn't even know where to start so I ended the question. I kind of understand how to do stacks but it still confuses me. I tried to give everyone who helped me some of the points. I didn't realize that the grade would be a problem. I always appreciate the help I get from the experts on this sites. It really helps me. That's why I wanted to give points to everyone because at least they tried to help me.

Anyway sorry for the confusion. In my world a B is pretty good but I'll keep it in mind next time.

Angela
Angela,

I agree with you.
Anyway if you are looking for some additional information, please refer to the book that I mentioned in my first post.

Hope it helps
-tom
Thanks Tom and everyone else for your help. I really do appreciate it.

Angela :)
Angela, you say "I will admit that the answers wasn't clear to me so that's why I didn't give it an A but I didn't think they were bad answers.", in which case, you should ask for more explanation.  We are trying to make it as clear as possible, so that you can learn from the experts here.  And a while a B is a 'good' grade, if you don't ask for more expalantion when something is not clear, how are we to be able to guess that you need more in the way of information.  When you don't ask we must assume that what has been provided satisfies your current needs, and no further effort is needed.  In that casxe, a 'B' seems to be a 'slap in trhe face'.  Most of the people here have many claims on their time, and cannot/will not volunteer more details that seems to be needed, just to see their words types on the screen.  If more details are needed, and that need is expressed, then we are more than willing to explain, but when the need is not expressed, then very few will offer what would appear to be un-needed verbage.

AW
Let it go Arthur... let's move on.

-tom
Hi again,
I'm sorry but I am confused. I didn't mean to slap anyone in the face and I'm not sure how I did. I really do appreciate the help everyone gives me....its been crucial for me this semester. I really didn't think a B would offend anyone. I have read the help section about grading and I will take it into consideration next time I ask a question and grade someone, as I know that its important to the experts. I'm new to this site and I tried to explain why I gave the grade I did but it still seems to be misunderstood. I don't know anything else to say except I'm learning as I go along so please be patient with me.

Thanks again Tom and everyone else who helped,

Angela
No problem Angela, your decision was correct to my eyes... it is what I had done in your position.
You not have to explain your actions here to anyone. Who cares A, B or C anyway... the purpose here is "help each other" not "compete each other, be the first and the hell with others" so... again, you not have to explain anything!!!

Enjoy the information!!! Enjoy the site!!! Keep going...
-tom