From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,248d2a0e5d01f107 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-07-12 16:02:34 PST Path: archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-post-01!supernews.com!corp.supernews.com!not-for-mail From: achrist@easystreet.com Newsgroups: comp.lang.ada Subject: Re: Problem with Gnat.Dynamic_Tables Date: Fri, 12 Jul 2002 16:02:49 -0700 Organization: Posted via Supernews, http://www.supernews.com Message-ID: <3D2F6019.38FC11A7@easystreet.com> X-Mailer: Mozilla 4.79 [en] (WinNT; U) X-Accept-Language: en MIME-Version: 1.0 References: <3D2B6BFB.D4468F57@easystreet.com> <5ee5b646.0207110713.a6b5a05@posting.google.com> <3D2DEC07.9E47AC3@easystreet.com> <5ee5b646.0207111942.58720e6f@posting.google.com> <3D2E7EBC.C629C700@easystreet.com> <3D2EE650.8070200@bluewin.ch> <3D2F0A3D.8DEF335F@easystreet.com> <9c20a68d.0207121452.3ff1eb2f@posting.google.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Complaints-To: newsabuse@supernews.com Xref: archiver1.google.com comp.lang.ada:27031 Date: 2002-07-12T16:02:49-07:00 List-Id: 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