Thanks guys, Just one thought though,
The order of keys is a side-effect of the implementation. Was it really the specification for maps implementation? ~Ketan On Fri, May 28, 2010 at 12:22 AM, Lev Neiman <[email protected]> wrote: > It is so the keys would be ordered in the map. This is useful in a lot of > cases. When you iterate through entries in std::map you are iterating in a > specific order. You can define that order yourself by giving map your own > custom comparator. This is actually useful in a lot of cases. With hashmap > there is no order to the entries. Also there is SGI's implementation of > hash_map that I believe somebody already talked about in this conversation. > - Lev. > > > On Wed, May 26, 2010 at 2:48 AM, Ketan Joshi <[email protected]>wrote: > >> Hi guys, >> >> This could be a wrong forum for such a question, but I am posting it here >> anyways. >> >> I read somewhere that c++ maps are implemented using height balanced trees >> (red black trees specifically). >> >> Why wasn't it implemented using hash tables? wouldn't it have been faster >> specially since maps dont allow duplicate keys? >> >> ~Ketan >> >> -- >> You received this message because you are subscribed to the Google Groups >> "google-codejam" group. >> To post to this group, send email to [email protected]. >> To unsubscribe from this group, send email to >> [email protected]<google-code%[email protected]> >> . >> For more options, visit this group at >> http://groups.google.com/group/google-code?hl=en. >> > > -- > You received this message because you are subscribed to the Google Groups > "google-codejam" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]<google-code%[email protected]> > . > For more options, visit this group at > http://groups.google.com/group/google-code?hl=en. > -- Blog: http://beingkejo.wordpress.com -- You received this message because you are subscribed to the Google Groups "google-codejam" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/google-code?hl=en.
