views:

544

answers:

5

I’d like to study the source code for a fast and memory efficient hashmap implementation. Any suggestions where I can find one online?

A: 

uthash may be a good option, it is written in C

Brian R. Bondy
+1  A: 

With visual studio, you could start with the one in the stdext namespace (2008 and earlier) or the STL one in VS 2010. See <unordered_set> and <unordered_map>.

KJAWolf
A: 

This one's in C, but it shouldn't be that different from a C++ implementation:

http://attractivechaos.awardspace.com/khash.h.html

Other options available here:

http://web.ics.purdue.edu/~gupadhya/newWebSite/code.html

Amber
A: 

You can take a look at the source for boost::unordered.

bdonlan