English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

Browse thread
[Caml-list] sorting Hashtbl.t
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2002-08-12 (13:44)
From: Oleg <oleg_inconnu@m...>
Subject: Re: [Caml-list] sorting Hashtbl.t
On Monday 12 August 2002 05:51 am, Nicolas Cannasse wrote:
> > [1] One could of course copy elements to a list or an array, then sort
> > and iterate the latter, but I suppose it is inefficient, as hash table
> elements
> > are "almost sorted".
> In general, Hashtbl are not "almost sorted", as one cannot garantee that
> key(x) < key(y) => x < y.

I meant sorting by key (or iterating Hashtbl in the order of increasing 

> If you want such a behavior, you should use a Binary Search Tree instead.

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