caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Jonathan <jonikelee@gmail.com>
To: Lukasz Stafiniak <lukstafi@gmail.com>, Caml <caml-list@inria.fr>
Subject: Re: [Caml-list] Why AVL-tree?
Date: Sun, 15 Jun 2014 10:01:08 -0400	[thread overview]
Message-ID: <539DA724.3080405@gmail.com> (raw)
In-Reply-To: <CAJMfKEUW7W6MALj4i0Y1s8CejYEEwmGa5i5_O0yK=Gdhv3vbSA@mail.gmail.com>

On 06/15/2014 12:51 AM, Lukasz Stafiniak wrote:
> Here is a 2-imbalance AVL trees example from InvarGenT:
> https://github.com/lukstafi/invargent/blob/master/examples/avl_tree.gadt
> and the (inferred) types:
> https://github.com/lukstafi/invargent/blob/master/examples/avl_tree.gadti.target
>
> Regards,
> Lukasz

Thank you for those links, Lukasz.  I see from them that there is a 
difference between 2-imbalance AVL trees and gap trees.  In 2-imbalance 
AVL trees, as with standard AVL trees, the parent height is always 1 + 
the maximum child height.  In gap trees, a parent's height can in some 
cases be 2 above the height of both children, even though the childrens' 
heights never differ by more than 1.

I am wondering how important this difference is.  For example, with gap 
trees, there is at most one rebalancing needed per insertion or deletion 
operation.  My understanding of standard AVL trees is that they may 
require O(logN) rebalancings per insertion or deletion.  Do you know how 
the 2-imbalance property addition changes this rebalancing requirement 
for AVL trees?

Thanks again,
Jonathan

>
> On Tue, Jun 10, 2014 at 11:19 AM, <jonikelee@gmail.com> wrote:
>
>> I am coming here from the Coq mailing list, because of a link posted there
>> about this e-mail thread.  I have been working on Coq-verified and fully
>> proof-erased versions of AVL and red-black trees, as well as a variant I
>> didn't know existed before, until I read about "2-imbalance AVL trees" in
>> this
>> thread.
>>
>> The github address for my development is:
>>
>> https://github.com/jonleivent/mindless-coding
>>
>> and the "gaptree" development there may be the same as your "2-imbalance"
>> AVL
>> trees, though I can't be sure without more of an explanation (or maybe
>> just a
>> pointer to the source code) for the 2-imbalance AVL trees.
>>
>> Any further information or source pointers you can give me would be greatly
>> appreciated.
>>
>> Thanks
>> --Jonathan
>>
>> --
>> 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
>>


  reply	other threads:[~2014-06-15 14:01 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
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 [this message]
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=539DA724.3080405@gmail.com \
    --to=jonikelee@gmail.com \
    --cc=caml-list@inria.fr \
    --cc=lukstafi@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;
as well as URLs for NNTP newsgroup(s).