Re: Generics question
- From: "Adam Benson" <Adam.Benson@xxxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Tue, 12 Feb 2008 11:51:35 -0000
Hi,
Not too sure what level you're coming at this from, so If I've
oversimplified my apologies.
A stack is a bit like an array, but you can only get at the "first"
element - the top of the stack.
For example, If I push these strings on to a stack : "one", "two", "three",
"four" the stack looks like this :
"four" <--- top of the stack
"three"
"two"
"one"
If I now perform a Pop on the stack I get "four" back and the stack looks
like this :
"three" <---- top of the stack
"two"
"one"
If I then push "five" on to the stack it looks like this :
"five" <---- top of the stack
"three"
"two"
"one"
And "five" is what you get if you perform a pop. So you'd use a stack to
queue up objects when it was important to always get the most recently
queued object. They can also be called a LIFO queue - Last In First Out.
HTH,
Adam
==========
.
- References:
- Generics question
- From: Mike P
- Generics question
- Prev by Date: Generics question
- Next by Date: Re: Generics question
- Previous by thread: Generics question
- Next by thread: Re: Generics question
- Index(es):
Relevant Pages
|