LedZep,
It sounds like you realize there is a difference of someone doing the
assignment for you, which is cheating. And you asking in the newsgroup what
a stack is and how it works. Some students don't realize this or care about
this, they simple want the assignment done, hence my and Tom's caution.
However the assignment is designed to get you to understand how a stack
works, so answering the question is one of those gray areas when it could be
considered cheating.
I also hope you realize that if your teacher is truly as bad as you make him
sound and other students feel this way, that is a matter for the
administration of the school.
Any way, what is a stack:
http://abstractvb.com/code.asp?A=1023
A stack is an object that stores other items (objects), where these other
items can be retrieved in a LIFO (Last In, First Out) manner. To put items
on the stack you use stack.Push(item) to remove items from the stack you use
item = stack.Pop, where stack is your Stack variable.
Think of a stack as the dispenser for trays or plates at a cafeteria. When
the kitchen help puts more trays on the top of the dispenser the old ones
are pushed down, when you pick up a tray to get your food you get the last
one put on the dispenser, its popped off the top.
If you think of how the stack works last in, first out, think how that could
be used to reverse the order of a string.
If you take the first character of a string and put it on the stack, if you
take the next character of a string and put it on the stack...
If you pop a character off the stack, and put it on the end of a new string,
if you pop another character off the stack and put it on the end of a new
string...
Hope this helps
Jay
"LedZep" <wa*********@hotmail.com> wrote in message
news:30**************************@posting.google.c om...
Basically I dont know what a stack is or why I have to use it. Why
cant I just do it how Sergey says. I dont want someone to write the
entire code and send it to me. I just want to understand what the hell
I'm doing and why. Thats the problem with my teacher - he does the
complete opposite... which is nothing.
Thanks for any replies...
LedZep