Re: How does a linked-list optimize a stack ?



Jeff?Relf <Jeff_Relf@xxxxxxxxx> wrote:

Are you ( Mr. Voigt ) telling me Jack is using a linked-list
because he needs a ? queue or stack ? ? I can't tell what Jack wants.

How does a linked-list optimize a stack,
? blowing sorted arrays out of the water ? ?

A sorted array is by nature of fixed size. When the stack fills it, you
have to allocate a bigger chunk and copy the old data. With a linked list,
you just keep adding items on the end.

If you know a maximum upper bound for the stack size, then an array is
better.

Is it like several seconds faster for very large stacks ?

"Several seconds faster" is not a particularly meaningful measure. If you
do billions of pushes and pops, a few cycles here and there makes a pretty
big difference.
--
Tim Roberts, timr@xxxxxxxxx
Providenza & Boekelheide, Inc.
.



Relevant Pages

  • Re: 200 horse on ftp tonight
    ... > 16 Paid, I finished 17th, lol. ... > Jack on 6th street for about 80% of my stack. ... mouth, ...
    (rec.gambling.poker)
  • Re: What Is What Is This Shit?
    ... Stack 'em up with The Band and let the night ... Jersey Jack ... Hey, I didn't say that those three were the best for that purpose, only ...
    (rec.music.dylan)
  • Why I hate Omaha
    ... I jam and a ... huge stack calls and the flop comes: ... I knew the villain had a jack. ...
    (rec.gambling.poker)
  • Re: Where is a static variable stored?
    ... Jack wrote: ... it is located in the data segment of the program. ... a static variable in the stack. ... extra work to be unlikely to be the chosen mechanism; ...
    (comp.lang.c)
  • Re: const &
    ... Jack ... param can not be modified on the stack ... Prev by Date: ...
    (microsoft.public.vc.language)