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,ac39a12d5faf5b14 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-04-24 10:49:09 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed1.cidera.com!Cidera!cyclone.socal.rr.com!cyclone3.kc.rr.com!news3.kc.rr.com!twister.socal.rr.com.POSTED!not-for-mail Message-ID: <3CC6F022.D0179BE2@san.rr.com> From: Darren New X-Mailer: Mozilla 4.77 [en] (Windows NT 5.0; U) X-Accept-Language: en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Grace and Maps (was Re: Development process in the Ada community) References: <3CB46975.90408@snafu.de> <3CBAFFEE.2080708@snafu.de> <4519e058.0204171036.6f0a7394@posting.google.com> <3CBDD795.4060706@snafu.de> <4519e058.0204180800.44fac012@posting.google.com> <3CBF0341.8020406@mail.com> <4519e058.0204190529.559a47ae@posting.google.com> <3CC1C6B3.6060306@telepath.com> <3CC21747.5000501@telepath.com> <4519e058.0204220534.2eb33730@posting.go <3CC6EA85.CA2735B2@boeing.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Date: Wed, 24 Apr 2002 17:48:05 GMT NNTP-Posting-Host: 66.75.151.160 X-Complaints-To: abuse@rr.com X-Trace: twister.socal.rr.com 1019670485 66.75.151.160 (Wed, 24 Apr 2002 10:48:05 PDT) NNTP-Posting-Date: Wed, 24 Apr 2002 10:48:05 PDT Organization: RoadRunner - West Xref: archiver1.google.com comp.lang.ada:23070 Date: 2002-04-24T17:48:05+00:00 List-Id: Jeffrey Carter wrote: > Darren New wrote: > > > > Jeffrey Carter wrote: > > > Skip lists are probabilistically balanced. Average search times are > > > O(log N). The good news is that even a halfway decent random-number > > > generator ensures decent balancing if N is large enough to matter. See > > > figure 8 in > > > > > > ftp://ftp.cs.umd.edu/pub/skipLists/skiplists.pdf > > I was a bit imprecise in my language here. The quality of the generator > is not very important if insertions are fairly random. If insertions > tend to be ordered, a poor generator can degrade performance. With a > decent generator, such as the Ada.Float_Random that comes with GNAT, the > order of insertions is immaterial. FWIW, I didn't write this part, in spite of quoting anomolies. :-) > > Here's my "Top Ten" list... > > Looks like 6 to me, with three of them being reasons skip lists are > better :) It's a joke, son. A joke, Ah say. > I don't expect generic components to be suitable for secure > applications. I would expect generic components to be sufficiently secure to allow them to be used as (say) part of a CGI script or something. But I think as long as the potential pitfalls of a worst-case performance are documented along with how to get around them, it's cool. > With the recommended p=0.25, they take an average of 1.333 > pointers/node. This would degrade performance, tho, yes? An average of two extra link-follows per search? Or am I misunderstanding? (Maybe "p" should be a parameter? Nah, too messy.) > True for an unbounded implementation. You could make all the nodes the > same size, if you don't mind the wasted space :) Naturally, a bounded > implementation avoids fragmentation. And I guess with a bounded implementation, you know the right maximum height too. > For a general purpose component, I don't see trees offering > insert/delete without a search, either. I think you can do this, since Red-Black trees keep a pointer to the parent. I'm not sure tho, and yes, another friend explained how you'd go about keeping enough info in a skip-list iterator (basically, N backpointers where N is the height of the head) to do the inserts and deletes without the search. > A *little* more complicated? I've seen balanced tree deletion algorithms > in texts that run to 4 pages; Nah. http://ciips.ee.uwa.edu.au/~morris/Year2/PLDS210/red_black.html Not *that* complicated. I'll admit it's not *obvious*, but once given, it's not *complicated*. On the other hand, skip-list implementations are *obvious*, but whether they're efficient isn't obvious. Of course, the paper shows they are. > Between the significantly simpler algorithms, which are more likely to > be implemented correctly, and the observed performance advantages of > skip lists, the choice seems obvious. Fair enough. I'm convinced. :-) Add a backpointer to each node as well, and you've got a doubly-linked list that you can search really, really fast. :-) -- Darren New San Diego, CA, USA (PST). Cryptokeys on demand. The 90/10 rule of toothpaste: the last 10% of the tube lasts as long as the first 90%.