V
Vanessa T.
Hello All!
Is there a place where I can learn stacks, (push and pop) etc.
Thanks,
Is there a place where I can learn stacks, (push and pop) etc.
Thanks,
Vanessa T. said:Hello All!
Is there a place where I can learn stacks, (push and pop) etc.
Thanks,
Vanessa T. said:Hello All!
Is there a place where I can learn stacks, (push and pop) etc.
Thanks,
Yep. Your kitchen! Seriously!
Take some plates. Stack them.
If you put a new plate on top of that stack, you 'push' it onto the
stack.
If you take the topmost plate from the stack, you 'pop' it from
the stack.
Observation: In the pop operation you always get the plate which
was pushed last. That's why such a structure is called LIFO (last in,
first out).
That's all. Simple, isn't it?
And trying to take more plates off the stack than you put on (which isOne more thing : if you try to put to much plates, the can fall off
the table (which is called a stack overflow). Not something you want.
Jonathan
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.