Browse thread
RE: [Caml-list] Efficient and canonical set representation?
[
Home
]
[ Index:
by date
|
by threads
]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
| Date: | -- (:) |
| From: | Julien Signoles <Julien.Signoles@l...> |
| Subject: | RE: [Caml-list] Efficient and canonical set representation? |
On Mon, 10 Nov 2003, Diego Olivier Fernandez Pons wrote: > Patricia sets seem to be what you are looking for. > (1). Efficient usual operations (lookup, insertion, union) > (2). Structural equality > > Their only problem is that they cannot handle polymorphic orderable > types but only integers... > > Hash the data, use this key to insert it in a patricia map and solve > the collisions by chaining in an ordered list (with the polymorphic > [compare] function). (1) and (2) still hold under usual hypothesis on > the rate of collisions. > > A few changes to JCF's implementation should be enough. I think JCF's Hmap module is what you want. A hmap is a map over hash-consed values implemented as Patricia Trees. See http://www.lri.fr/~filliatr/software.en.html for more details. Julien Signoles -- mailto:Julien.Signoles@lri.fr ; http://www.lri.fr/~signoles "In theory, practice and theory are the same, but in practice they are different" (Larry McVoy) ------------------- 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