comp.lang.ada
 help / color / mirror / Atom feed
From: Stephen Leake <Stephen.A.Leake@nasa.gov>
Subject: Re: Data Structure Choice for DOM
Date: 10 Mar 2003 14:10:31 -0500
Date: 2003-03-10T19:24:27+00:00	[thread overview]
Message-ID: <u7kb76nrs.fsf@nasa.gov> (raw)
In-Reply-To: oq8aa.16405$EN3.133044@newsfep4-glfd.server.ntli.net

"chris.danx" <spamoff.danx@ntlworld.com> writes:

> Simon Wright wrote:
> > Do it the way that gets you working code quickest, profile it (speed
> > and memory), and choose another implementation for this part if it's
> > justified.
> 
> :)  "Premature optimisation is the root of all evil" or something like that?
> 
> Linked list is easiest & quickest.  It'll be O(n) in worst case but
> it'll work.  Later I'll change it to an AVL tree or something else.

Be sure to use a good library of data structures, like Booch, Charles,
or SAL. They have consistent interfaces to similar data structures, so
changing from a linked list to an AVL tree is not hard.

In addition, they make it no harder to use an AVL tree instead of a
linked list in the first place, since the hard part is already done.

Write the requirements for the code, including the time behavior (is
O(n) really ok?). That makes it easy to pick from the available,
implemented and tested data structures.

-- 
-- Stephe



  reply	other threads:[~2003-03-10 19:10 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-03-07 18:49 Data Structure Choice for DOM chris.danx
2003-03-07 21:29 ` Simon Wright
2003-03-07 21:46   ` chris.danx
2003-03-10 19:10     ` Stephen Leake [this message]
2003-03-07 22:48 ` Kevin Cline
2003-03-08 21:47   ` chris.danx
2003-03-11  2:04 ` Matthew Heaney
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox