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-Thread: 103376,f5142427a147e149 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!postnews.google.com!v45g2000cwv.googlegroups.com!not-for-mail From: "Matthew Heaney" Newsgroups: comp.lang.ada Subject: Re: Equivalent keys/elements in Ada.Containers Maps and Sets Date: 23 Jan 2007 08:47:29 -0800 Organization: http://groups.google.com Message-ID: <1169570849.242150.292730@v45g2000cwv.googlegroups.com> References: <45b60602$0$24602$39db0f71@news.song.fi> <1169567122.501077.189450@s48g2000cws.googlegroups.com> NNTP-Posting-Host: 66.162.65.129 Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" X-Trace: posting.google.com 1169570855 26102 127.0.0.1 (23 Jan 2007 16:47:35 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Tue, 23 Jan 2007 16:47:35 +0000 (UTC) In-Reply-To: <1169567122.501077.189450@s48g2000cws.googlegroups.com> User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.9) Gecko/20061206 Firefox/1.5.0.9,gzip(gfe),gzip(gfe) Complaints-To: groups-abuse@google.com Injection-Info: v45g2000cwv.googlegroups.com; posting-host=66.162.65.129; posting-account=Zl1UPAwAAADEsUSm1PMMiDjihtBlZUi_ Xref: g2news2.google.com comp.lang.ada:8430 Date: 2007-01-23T08:47:29-08:00 List-Id: Matthew Heaney wrote: > Niklas Holsti wrote: > > > > One point where this may be significant is the definition of the "=" > > operator on Sets in A.18.7(20/2). The definition requires each element > > of the Left set to be compared for "=" with the elements of the Right > > set. If the actual "=" function is unrelated to the Hash function or to > > the "<" operator for elements, I don't see how the "=" operator on Sets > > can be implemented in less than O(N**2) complexity. > > No, your premise is false. > > E1 = E2 => Hash (E1) = Hash (E2) > > Equality is always O(1). There are no operations that are O(N**2). ^^^^^^ Oops! I meant to say that equality is always O(n). -Matt