Re: pop/push, shift/unshift



On Tue, 23 Oct 2007 12:53:02 +0900, Simon Schuster wrote:

just trying to get a gut-grip on these four array processes, and I'm
pushing and popping and shifting and unshifting left and right (and back
and forth?) and it's taking a surprising amount of time to "grok" them.
does anyone think this is a naming convention that could benefit with
some change, or am I just being strange?

<http://en.wikipedia.org/wiki/Stack_%28data_structure%29#Operations>


The way I think of a stack is as, literally, a stack of plates. A
cafeteria with a stack of plates where the stack is placed on a spring so
that when one plate is picked up (popped), the one below pops up and can
be accessed. The other plates aren't accessible because they're in the,
err, cabinet. When a plate is put on the stack, of course, it pushes
down the other plates.


-Thufir


.



Relevant Pages

  • Re: When is a stack used in real life?
    ... What you really want for plates is ... > My socks form a mathematical set in that no two are alike. ... > stack, the plate is still warm and wet from its washing. ... > dishwashers are out back for a smoke, ...
    (comp.programming)
  • Re: Stack of 7-10 plates
    ... I need to make a "large run" of mounting plates - for me that means more ... sets of related holes. ... Would you stack, clean up the edges, drill the holes (they need to be ... then separately do the counter sinking on a drill press? ...
    (rec.crafts.metalworking)
  • Re: When is a stack used in real life?
    ... What you really want for plates is ... My socks form a mathematical set in that no two are alike. ... stack, the plate is still warm and wet from its washing. ... dishwashers are out back for a smoke, ...
    (comp.programming)
  • Re: Stacks
    ... >> Take some plates. ... Stack them. ... >> If you put a new plate on top of that stack, you 'push' it onto the ... The Ultimate Truth is that there is no Ultimate Truth ...
    (comp.lang.cpp)
  • Re: What does an "export" do?
    ... :>: Dan Mercer wrote: ... You seem to be using "stack" in a way different from most programmers. ... staff adds new plates to the top and then customers take them off. ... terminology, and, living fossil that I am, I never changed. ...
    (comp.unix.shell)