From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on ip-172-31-65-14.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-3.2 required=3.0 tests=BAYES_00,NICE_REPLY_A, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 Path: eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail From: "Jeffrey R.Carter" Newsgroups: comp.lang.ada Subject: Re: Use Ada.Containers.Vectors Generic_Sorting or Ada.Containers.Ordered_Sets ? Date: Tue, 14 Feb 2023 10:35:23 +0100 Organization: A noiseless patient Spider Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Tue, 14 Feb 2023 09:35:24 -0000 (UTC) Injection-Info: reader01.eternal-september.org; posting-host="af648e4fc637b087f4cbeae5e35f9a72"; logging-data="2612027"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX198DDMz/TMKsv+u8pG56cU3Jtlm0khmxPw=" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.7.1 Cancel-Lock: sha1:dQJ2scCm9K5iJVnXnJoKj+PDUo8= Content-Language: en-US In-Reply-To: Xref: reader01.eternal-september.org comp.lang.ada:64928 List-Id: On 2023-02-14 09:49, reinert wrote: > > Sometimes, I have to sort records. One possibility is to use Generig_Sorting under Ada.Containers.Vectors and eksplicitly use Sort. An alternative is to use Ada.Containders.Ordered_Sets and somehow get sorting "for free". > > I would like to get arguments for and against these two alternatives. Both should be O(NlogN), so the distinction is which works better for what you do with them after they are sorted. -- Jeff Carter "[B]ecause of our experience in security, we are convinced that C is too error-prone. Its loose typing, its unsafe bitfields management, too many compiler dependent behaviors, etc. easily lead to vulnerabilities." EwoK developers 163