From: achrist@easystreet.com
Subject: Re: Problem with Gnat.Dynamic_Tables
Date: Fri, 12 Jul 2002 16:02:49 -0700
Date: 2002-07-12T16:02:49-07:00 [thread overview]
Message-ID: <3D2F6019.38FC11A7@easystreet.com> (raw)
In-Reply-To: 9c20a68d.0207121452.3ff1eb2f@posting.google.com
Mats Weber wrote:
>
> achrist@easystreet.com wrote in message news:<3D2F0A3D.8DEF335F@easystreet.com>...
>
> > [...] I see that it
> > works like a Map, which means, I suppose, that there is some search
> > involved in simply accessing an element of the array, but this is not a
> > noticeable problem, given all the other inefficiencies in my code, which
> > hardly add up to anything noticeable in toto.
>
> Dynamic_Array is implemented using AVL trees. So there is searching
> involved for each access and the complexity is O(Log N). But it is a
> far better choice than an array implementation if your key values are
> sparse.
No, my key values are not sparse, I've got all the keys from 0 to N,
where N might get up to 10^5 or so, less than 10^4 for the app at hand.
Your dynamic_array was the first best thing I saw available free off the
shelf for a variable N array of unbounded_string components. As a
believer in not reinventing anything that's already been reinvented, I
sure don't want to write any code when there's something already that
works. And I do mean "any code".
Any other freely available package do this better?
Al
prev parent reply other threads:[~2002-07-12 23:02 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-07-09 23:04 Problem with Gnat.Dynamic_Tables achrist
2002-07-11 0:19 ` achrist
2002-07-11 15:13 ` Robert Dewar
2002-07-11 20:35 ` achrist
2002-07-12 3:42 ` Robert Dewar
2002-07-12 7:01 ` achrist
2002-07-12 14:23 ` Mats Weber
2002-07-12 16:56 ` achrist
2002-07-12 22:52 ` Mats Weber
2002-07-12 23:02 ` achrist [this message]
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox