Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

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: -- (:)
From: Nicolas Cannasse <warplayer@f...>
Subject: Re: [Caml-list] sorting Hashtbl.t
> [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
> are "almost sorted".

In general, Hashtbl are not "almost sorted", as one cannot garantee that
key(x) < key(y) => x < y.
If you want such a behavior, you should use a Binary Search Tree instead.

Nicolas Cannasse

To unsubscribe, mail Archives:
Bug reports: FAQ:
Beginner's list: