From: Diego Olivier Fernandez Pons <Diego.FERNANDEZ_PONS@etu.upmc.fr>
To: Seth Fogarty <sfogarty@gmail.com>
Cc: caml-list@pauillac.inria.fr
Subject: Re: [Caml-list] Re: Set and Map question
Date: Mon, 20 Sep 2004 10:32:35 +0200 (DST) [thread overview]
Message-ID: <Pine.A41.4.44.0409201022110.413836-100000@ibm1> (raw)
In-Reply-To: <c7ee6112040919211867048703@mail.gmail.com>
Bonjour,
> Yes, sorry, sorted. I know it is possible, I was wondering if it was
> implemented.
I never understood how worked those functions building a balanced
search tree from a sorted list in O(n) _without_ first counting the
number of elements in the list.
Hence it is not implemented in Baire. As far as I know, there is no
Caml implementation of any of them either (they all iter on the list
applying O(log n) insertion function) but I may be wrong.
SML/NJ standard library has a O(n) 'from_ordered_list' function for
red-black trees. SML/NJ implementation of red-black trees uses zippers
to handle insertion and deletion operations. It may be difficult to
understand if you are not used to them.
Ralf Hinze wrote a good paper on red-black trees (Constructing
red-black trees, WAAAPL'99, available from his website). It explains
how to implement 'from_ordered_list' in O(n) and most of existent
functional implementations must be more or less based on it.
Diego Olivier
-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
next prev parent reply other threads:[~2004-09-20 8:35 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-09-20 2:37 [Caml-list] " Seth Fogarty
2004-09-20 3:14 ` [Caml-list] " Seth Fogarty
2004-09-20 3:56 ` skaller
2004-09-20 4:18 ` Seth Fogarty
2004-09-20 6:43 ` skaller
2004-09-20 8:32 ` Diego Olivier Fernandez Pons [this message]
2004-09-20 4:02 ` Brian Hurt
2004-09-20 8:17 ` Richard Jones
2004-09-20 12:41 ` Igor Pechtchanski
2004-09-20 12:54 ` Jean-Christophe Filliatre
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Pine.A41.4.44.0409201022110.413836-100000@ibm1 \
--to=diego.fernandez_pons@etu.upmc.fr \
--cc=caml-list@pauillac.inria.fr \
--cc=sfogarty@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox