On Wed, Apr 24, 2002 at 11:47:28AM -0400, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> If so, why would you use an array for this sort of thing. Way back
> in time when I was taking Intro to Programming, they taught us to use
> linked lists for this type of scenario where you didn't know up front
> how many items you'd need to store.
>
> I know there's usually a huge disconnect between "How things are taught"
> and "How things are". Is this the situation here? Why? What are
> the pros/cons of using arrays vs. linked lists in this type of
> scenario?
>
> Please help me be less ignorant :)
Well, I have no idea what's going on in this specific case, but
a fuller study of algorithms may cover "Dynamic Tables" (I don't recall
hearing about them before grad school). Dynamic Tables are like arrays,
which grow to twice the current size when they fill up, and contract
when they are only 1/4 full. Those ratios are very important (i.e., you
can't contract when only 3/4 full) to achieve O(n) (I believe)
operation.
A quick Google search turned up
http://www.google.com/search?q=cache:www.idt.mdh.se/kurser/cd5370/01/amortized.pdf
--
Bob Bell Compaq Computer Corporation
Software Engineer 110 Spit Brook Rd - ZKO3-3/U14
TruCluster Group Nashua, NH 03062-2698
[EMAIL PROTECTED] 603-884-0595
*****************************************************************
To unsubscribe from this list, send mail to [EMAIL PROTECTED]
with the text 'unsubscribe gnhlug' in the message body.
*****************************************************************