in reply to Re: Bidirectional lookup algorithm? (try perfect hashing)
in thread Bidirectional lookup algorithm? (Updated: further info.)

Ok. Here's a crude demo in case someone is interested in doing benchmarking comparisons or whatever. The program is pure C, tested on linux 64-bit. Give two arguments: Nkeys and Filename. File should contain sym-value pairs, both unique in their domains. (Space-separated, one pair per line).

Update. Some additional notes regarding the program.

Portability is easily improved upon: There are at least two bugs to fix: Many further optimizations to consider: There's also a wishlist for the CMPH library, but enough for now.