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,14bff0642983a2a5 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-07-28 16:33:22 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news.uchicago.edu!yellow.newsread.com!netaxs.com!newsread.com!feed3.newsreader.com!newsreader.com!newsfeed.news2me.com!elnk-nf2-pas!elnk-pas-nf1!newsfeed.earthlink.net!stamper.news.pas.earthlink.net!newsread4.news.pas.earthlink.net.POSTED!not-for-mail From: "Matthew Heaney" Newsgroups: comp.lang.ada References: Subject: Re: sorting large numbers of large records X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 Message-ID: <5piVa.1736$Bg.946@newsread4.news.pas.earthlink.net> Date: Mon, 28 Jul 2003 23:33:21 GMT NNTP-Posting-Host: 65.110.133.134 X-Complaints-To: abuse@earthlink.net X-Trace: newsread4.news.pas.earthlink.net 1059435201 65.110.133.134 (Mon, 28 Jul 2003 16:33:21 PDT) NNTP-Posting-Date: Mon, 28 Jul 2003 16:33:21 PDT Organization: EarthLink Inc. -- http://www.EarthLink.net Xref: archiver1.google.com comp.lang.ada:40913 Date: 2003-07-28T23:33:21+00:00 List-Id: "Brien L. Christesen" wrote in message news:bg3fgg$qig$1@grapevine.wam.umd.edu... > > Does anyone know of a good way to do this kind of sort? Thanks in advance > for any responses. The list containers in the Charles library have a (quick)sort operation. You could read the records into a singly-linked list container, and then sort that. Lists allow the sort to be done without copying elements, by exchanging pointers. Alternatively, you could use a vector or array, and then use the generic sort algorithm (also part of the library) to sort that. A vector is more space efficient, but a sort requires copying of elements. Another option is to read the records into a set, which automatically sorts elements as they are inserted into the container. (Sets and maps are implemented using a balanced tree.) A set is probably overkill, though, because you don't need do lookups or anything. If all you want to do is sort, then try using a list. The Charles library is available from my website. http://home.earthlink.net/~matthewjheaney/charles/ Look for a new release of Charles in the next few days. I am currently synchronizing the interfaces of the hashed vs. sorted associative containers. Send me email if you have any specific library questions. -Matt