Thread overview
Associative Arrays
Jun 11, 2005
Ant^2i
Jun 11, 2005
Walter
Jun 12, 2005
Ben Hinkle
June 11, 2005
Are associative arrays implemented with hashtables?
Or does them use some tree structure?


June 11, 2005
"Ant^2i" <Ant^2i_member@pathlink.com> wrote in message news:d8fsdg$1ed6$1@digitaldaemon.com...
> Are associative arrays implemented with hashtables?
> Or does them use some tree structure?

Both. The source is in phobos/internal/aaA.d


June 12, 2005
"Ant^2i" <Ant^2i_member@pathlink.com> wrote in message news:d8fsdg$1ed6$1@digitaldaemon.com...
> Are associative arrays implemented with hashtables?
> Or does them use some tree structure?

When you say tree structure - do you mean a balanced tree like STL's map? The builtin AA uses trees but they aren't balanced expicitly. If you want a sorted associative array then check out one of the container template libraries like MinTL, DTL or Indigo. Since I wrote MinTL I know it has a sorted AA but I don't know all that much about the others.