From: Tom Ridge <tom.j.ridge+list@googlemail.com>
To: "Frédéric Bour" <frederic.bour@lakaban.net>,
"OCaml List" <caml-list@inria.fr>,
"Francois Berenger" <francois.berenger@inria.fr>
Subject: Re: [Caml-list] Do we have a B-tree implementation in ocaml?
Date: Fri, 6 Nov 2015 21:04:22 +0000 [thread overview]
Message-ID: <CABooLwO9NB59146PQ51Ob+spBuXYYwcKreO=_GHFCJPb7QpgEQ@mail.gmail.com> (raw)
In-Reply-To: <1446719674.22101.0@mail.lakaban.net>
[-- Attachment #1: Type: text/plain, Size: 1808 bytes --]
I am working on a B+ tree. We are focusing on the verification in Isabelle,
but it would not be too difficult maybe to get some working OCaml code
together. As Frederic says, maybe you just want a binary tree?
On 5 November 2015 at 10:34, Frédéric Bour <frederic.bour@lakaban.net>
wrote:
> If I understand well, you want an efficient rank function on a sequence,
> you are not particularly interested in B-trees.
>
> I have an implementation of balanced trees you might be interested into:
>
> https://github.com/def-lkb/grenier/blob/master/baltree/bt1.mli
>
> It is a binary tree with a smart constructor to ensure only balanced trees
> are built.
> Beside that, no other constraints are applied. In particular these are not
> search trees although those can easily be implemented on top.
>
> O(1) access to the size (number of items) is provided, and as such an
> O(log n) rank function.
>
> Performance is also quite competitive: although I did not push the code
> yet, I implemented Map and Set from the standard library using these trees.
> On a small set of benchmarks I ran, these were at worst 10% slower than the
> standard ones.
>
>
> On Wed, Nov 4, 2015 at 6:39 PM, Francois Berenger <
> francois.berenger@inria.fr> wrote:
>
> Hello, I am looking for even a simple implementation with at least the
> following operations: insert/add, remove, mem/contains and at_rank. The
> at_rank is especially important since it is inefficient to implement it
> using fold in a set like the ones from the stdlib. Thanks a lot, F.
> --
> 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: 2709 bytes --]
next prev parent reply other threads:[~2015-11-06 21:05 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-04 17:39 Francois Berenger
2015-11-05 10:34 ` Frédéric Bour
2015-11-06 21:04 ` Tom Ridge [this message]
2015-11-10 14:37 ` Simon Cruanes
2015-11-10 23:11 ` Hendrik Boom
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='CABooLwO9NB59146PQ51Ob+spBuXYYwcKreO=_GHFCJPb7QpgEQ@mail.gmail.com' \
--to=tom.j.ridge+list@googlemail.com \
--cc=caml-list@inria.fr \
--cc=francois.berenger@inria.fr \
--cc=frederic.bour@lakaban.net \
/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