473,237 Members | 1,392 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,237 software developers and data experts.

Stacks

Hello All!

Is there a place where I can learn stacks, (push and pop) etc.
Thanks,
Jul 19 '05 #1
5 2587

"Vanessa T." <Su******@its-raining.com> wrote in message
news:Mt********************@comcast.com...
Hello All!

Is there a place where I can learn stacks, (push and pop) etc.
Thanks,


http://www.google.com/search?sourcei...k+push+and+pop

-Ashish
Jul 19 '05 #2
Vanessa,

A simple stack would be synonomous to the following:

Bob is an office clerk. John is the boss. John puts report A in Bobs
INBOX. Two hours later John puts report B in Bobs INBOX. Think of the
INBOX as a stack of reports. Assume Bob always takes the report from the
top of the INBOX and processes it. He never takes it from the bottom. Our
stack (INBOX) looks like:

report B
report A

When John places report A in the INBOX, stack terms would mean INBOX.push
(A) or push it into the INBOX. When John places report B in the INBOX,
stack terms would mean INBOX.push (B). When Bob goes to get a report from
the INBOX, he doesn't care which one was placed in first, he just takes one
off the top or he (in stack terms) INBOX.pops (B)

push = add to top
pop = take from top

This type of container is what is called FILO (first in , last out) as the
example shows.

If you need more info...

http://www.eca.com.ve/cs/C++%20Ref/stacks.htm
or
http://www.cppreference.com/cppstack.html

this may be more indepth than what you are looking for
Kevin
"Vanessa T." <Su******@its-raining.com> wrote in message
news:Mt********************@comcast.com...
Hello All!

Is there a place where I can learn stacks, (push and pop) etc.
Thanks,

Jul 19 '05 #3


"Vanessa T." wrote:

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?

--
Karl Heinz Buchegger
kb******@gascad.at
Jul 19 '05 #4
> > 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?


One 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
Jul 19 '05 #5
On Wed, 8 Oct 2003 16:51:07 -0400, "Jonathan Mcdougall"
<jo***************@DELyahoo.ca> wrote:
> 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?


One 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

And trying to take more plates off the stack than you put on (which is
called stack underflow) is also something you want to avoid.

rossum

--

The Ultimate Truth is that there is no Ultimate Truth
Jul 19 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Ice | last post by:
Hi there, I'm not sure if this is the right group for this- If it isn't, could anyone point me in the right direction? For our data structures exam, we are usually asked to implement the...
6
by: Sathyaish | last post by:
I've searched Google and found a few, but I am not so satisfied. Any good reading on "stacks and heaps" about how and when memory is allocated from the heap?
18
by: pmm | last post by:
Hi all, Plz dont fire at me if this is a silly question Is there any way to know in which direction stack grows pmm
1
by: LedZep | last post by:
This program has to use a stack to determine whether a string is a palindrome (a string that is spelled identically backward and forward). The program has to ignore spaces, case sensitivity and...
10
by: Rich Kucera | last post by:
Holding all versions at 5.0.4, Multiple stacks with multiple-version configurations inevitable Will have to wait to see what the impact of problems such as http://bugs.php.net/bug.php?id=33643 ...
2
by: Daniel | last post by:
Hi, I have a question regarding the memory managment in stl stacks. I want to use stacks to store a very large amount of numbers (some millions), thus I'm interested in how the stack behaves...
2
by: chubbykelly | last post by:
hi, i got a prob with the new topic my teacher in data struct taught us this afternoon. he introduced the concept of stacks. simulated how 5 elements will be pushed and popped out to the array...
0
by: raghuveer | last post by:
i want to implement multiple stacks using arrays..I am able to create ,insert and print them but not poping an element form any of the stack..This is what i have #include<stdio.h>...
8
by: cerise | last post by:
I can't figure out how to make and handle multiple stacks and use them so I could create four linked list stacks representing each suit of cards, one stack each for diamonds, hearts, spades, and...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.