data structure question
Hal Daume III
hdaume@ISI.EDU
Wed, 17 Apr 2002 11:11:50 -0700 (PDT)
i need an associative data structure (like finitemap) which will map data
elements to Doubles. i don't need to be able to remove elements and don't
even need to insert elements once i've built the structure; all i really
care about is fast lookup. i have reasonable instances of Eq and Ord and
probably any other reasonable comparitive metric you could think
of. moreover, when i'm creating the data structure, i *know* the
(approximate) relative frequency of each element. that is, i know that
on average i will need to get the Double corresponding to element 'a' ten
times more frequently than the Double corresponding to element 'b'.
does anyone have any suggestions for data structures to solve such a
problem. i'm currently using FiniteMap, but would like something faster
(btw, there are a LOT of these elements -- around 1million or so).
- Hal
--
Hal Daume III
"Computer science is no more about computers | hdaume@isi.edu
than astronomy is about telescopes." -Dijkstra | www.isi.edu/~hdaume