From: "Fred Smith" <fsmith@mathworks.com>
To: "Samuel Lacas" <Samuel.Lacas@trusted-logic.fr>, <caml-list@inria.fr>
Subject: RE: [Caml-list] Efficient and canonical set representation?
Date: Fri, 7 Nov 2003 12:27:19 -0500 [thread overview]
Message-ID: <DB873318D1A41648BEAC4B5AAB63B3E101D0B8CD@MESSAGE-AH.ad.mathworks.com> (raw)
Ocaml has a structural comparison function (<=) : 'a -> 'a -> bool.
But the bigger problem with this approach (as Jean-Baptiste Rouquier) kindly pointed out to me is that insertion takes O(n), not O(log(n)) time. Duh.
-Fred
> -----Original Message-----
> From: owner-caml-list@pauillac.inria.fr
> [mailto:owner-caml-list@pauillac.inria.fr] On Behalf Of Samuel Lacas
> Sent: Friday, November 07, 2003 10:44 AM
> To: caml-list@inria.fr
> Subject: Re: [Caml-list] Efficient and canonical set representation?
>
>
> Fred Smith a écrit 2.2K le Fri, Nov 07, 2003 at 10:27:25AM -0500: #
> # I guess what you're looking for are sorted arrays:
> # 1) O(log n) lookup and insertion via binary search
> # 2) O(n) union and intersection are simple
> # 3) Equal sets are represented by structurally equivalent objects.
> #
> # -Fred
>
> Hmm, except that, if I'm not wrong, it was required the
> structure to hold any kind of object. Sorted arrays require
> the elements to be sortable. Using the hash of the objects
> may be an answer ?
>
> sL
>
> -------------------
> 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
-------------------
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 reply other threads:[~2003-11-07 17:27 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-11-07 17:27 Fred Smith [this message]
2003-11-10 13:24 ` Diego Olivier Fernandez Pons
2003-11-10 13:49 ` [Caml-list] Rounding mode Christophe Raffalli
2003-11-10 14:10 ` Eric Dahlman
2003-11-10 18:03 ` Brian Hurt
2003-11-10 20:35 ` Eric Dahlman
2003-11-10 23:09 ` Brian Hurt
2003-11-17 21:15 ` Xavier Leroy
2003-11-12 17:19 ` Diego Olivier Fernandez Pons
2003-11-13 15:47 ` Eric Dahlman
2003-11-17 17:03 ` Diego Olivier Fernandez Pons
2003-11-10 21:23 ` Christophe Raffalli
[not found] ` <16305.25815.3793.545198@karryall.dnsalias.org>
2003-11-12 15:35 ` [Caml-list] Rounding mode + extended Christophe Raffalli
2003-11-13 17:35 ` Xavier Leroy
2003-11-10 19:28 ` [Caml-list] Efficient and canonical set representation? Julien Signoles
-- strict thread matches above, loose matches on Subject: below --
2003-11-12 17:18 Harrison, John R
2003-11-12 3:34 Harrison, John R
2003-11-12 7:50 ` Brian Hurt
2003-11-12 0:20 Harrison, John R
2003-11-12 2:04 ` Brian Hurt
2003-11-12 16:16 ` Diego Olivier Fernandez Pons
2003-11-07 15:27 Fred Smith
2003-11-07 15:44 ` Samuel Lacas
2003-11-08 16:50 ` Eray Ozkural
2003-11-07 14:15 Harrison, John R
2003-11-06 16:41 Harrison, John R
2003-11-06 17:04 ` Brian Hurt
2003-11-07 3:43 ` Eray Ozkural
2003-11-07 3:52 ` Eray Ozkural
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=DB873318D1A41648BEAC4B5AAB63B3E101D0B8CD@MESSAGE-AH.ad.mathworks.com \
--to=fsmith@mathworks.com \
--cc=Samuel.Lacas@trusted-logic.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