caml-list - the Caml user's mailing list
 help / Atom feed
From: Christophe Raffalli <>
Subject: [Caml-list] O(n ln k) sorting for ocaml on github and a challenge
Date: Fri, 8 Oct 2021 18:05:33 -1000
Message-ID: <20211009040533.chu7kqqk27r5wcok@oulala> (raw)

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


I just pushed on an old piece of code: a
stable sorting algorithm which is in O(n ln k) where n is the size of the list
and k the number of changes of direction.  It is often much faster than
List.sort, on my tests, never more than 10% slower.  The tests are available on

If people are interested I could provide a version for arrays.

A challenge would be to provide a O(n ln k) sorting on list that is always
faster than List.sort. Any ideas ?


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

             reply index

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-09  4:05 Christophe Raffalli [this message]
2021-10-09  8:58 ` Mario Pereira
2021-10-09 19:59   ` Christophe Raffalli
2021-10-11 11:46     ` Niols
2021-10-11 21:27       ` Mario Pereira
2021-10-22  4:44 ` Kazuhiko Sakaguchi

Reply instructions:

You may reply publically 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:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211009040533.chu7kqqk27r5wcok@oulala \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

caml-list - the Caml user's mailing list

Archives are clonable: git clone --mirror

AGPL code for this site: git clone public-inbox