caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: "Andrew Herron" <andrew.herron@gmail.com>
To: "Damien Guichard" <alphablock@orange.fr>
Cc: "Caml List" <caml-list@inria.fr>
Subject: Re: [Caml-list] Why AVL-tree?
Date: Mon, 02 Jun 2014 06:34:32 -0700 (PDT)	[thread overview]
Message-ID: <1401716071976.85ecb8da@Nodemailer> (raw)
In-Reply-To: <543099239773658961@orange.fr>

[-- Attachment #1: Type: text/plain, Size: 1244 bytes --]

Wikipedia has some notes on the difference:


http://en.wikipedia.org/wiki/AVL_tree




AVL has faster lookup, so maybe they decided to optimise for that.




It's different to some other languages I've seen, but then so is their decision to not use a tail recursive List.map. Each to their own, it's not hard to implement the alternative :)

On Mon, Jun 2, 2014 at 11:21 PM, Damien Guichard <alphablock@orange.fr>
wrote:

>  
> Red-black tree would spare a machine word per node, because a red-black tree
> doesn't need depth information. 
> Hence the reason is either historical or a space/speed trade-off (comparing
> two depths may be faster than pattern matching). 
>  
> Regards,
>  
> damien guichard 
> Hi, list, 
> Just from the curiosity, why balanced binary trees used in Set and Map are
> AVL-trees, not their alternative, say, red-black trees?  Is there a deep
> reason for it, or just a historical one?
> Best,
> -- 
> Yoriyuki Yamagata
> http://yoriyuki.info/
> -- 
> Caml-list mailing list.  Subscription management and archives:
> https://sympa.inria.fr/sympa/arc/caml-list
> Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
> Bug reports: http://caml.inria.fr/bin/caml-bugs

[-- Attachment #2: Type: text/html, Size: 2110 bytes --]

  reply	other threads:[~2014-06-02 13:34 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-02 13:21 Damien Guichard
2014-06-02 13:34 ` Andrew Herron [this message]
2014-06-02 15:06   ` Gabriel Scherer
2014-06-03 12:48     ` Yaron Minsky
2014-06-03 13:12       ` Gabriel Scherer
2014-06-03 13:37         ` Yaron Minsky
2014-06-03 13:41       ` Yoriyuki Yamagata
2014-06-02 16:57   ` Xavier Leroy
2014-06-02 21:16     ` Andrew Herron
2014-06-10 18:19     ` jonikelee
2014-06-10 18:51       ` Florian Hars
2014-06-10 19:52         ` Jonathan
2014-06-15  4:51       ` Lukasz Stafiniak
2014-06-15 14:01         ` Jonathan
2014-08-03 21:25     ` Diego Olivier Fernandez Pons
  -- strict thread matches above, loose matches on Subject: below --
2014-06-02 18:23 Damien Guichard
2014-06-02 11:48 Yoriyuki Yamagata

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=1401716071976.85ecb8da@Nodemailer \
    --to=andrew.herron@gmail.com \
    --cc=alphablock@orange.fr \
    --cc=caml-list@inria.fr \
    /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;
as well as URLs for NNTP newsgroup(s).