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=-1.7 required=3.0 tests=BAYES_00,NICE_REPLY_A, REPLYTO_WITHOUT_TO_CC,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 Path: eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail From: "G.B." Newsgroups: comp.lang.ada Subject: Re: Use Ada.Containers.Vectors Generic_Sorting or Ada.Containers.Ordered_Sets ? Date: Tue, 14 Feb 2023 19:48:14 +0100 Organization: A noiseless patient Spider Message-ID: References: <8e3943a0-6dc5-4d8e-8c35-a35587f0d05fn@googlegroups.com> Reply-To: nonlegitur@notmyhomepage.de MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Tue, 14 Feb 2023 18:48:14 -0000 (UTC) Injection-Info: reader01.eternal-september.org; posting-host="32842b97cf7ce8b3b5513368cf34644b"; logging-data="2739589"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18BGBoMzwHwGzGnOdk5sfc1fV0Uc/bwdPg=" User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.6.1 Cancel-Lock: sha1:0ezGF68IAXvGW2C7ZGEvUWfbAXM= In-Reply-To: <8e3943a0-6dc5-4d8e-8c35-a35587f0d05fn@googlegroups.com> Content-Language: en-US Xref: reader01.eternal-september.org comp.lang.ada:64930 List-Id: On 14.02.23 11:46, reinert wrote: > My main argument for using Ordered_Sets is that it seems to be less verbose and somehow garanteres sorting. Myset.Last/First always provides the "largest"/"smallest" element. You could measure performance of operations that you find critical, given a typical number of elements in the set. If there isn't any operation that is particularly critical, some weighted average of all set operations might be of interest. Two similar data structures might both use a common algorithm, such as sorting. If a program uses both data structures, then having just one algorithm might be advantageous, if only for the size of the executable.