4 ms·
Cool! Hashtables make for a fun project, to be sure. Also worth checking out is uthash[1], which has been around for ever. It's a single header file include,
by AntiRush 11y ago
Cool! Hashtables make for a fun project, to be sure.
Also worth checking out is uthash[1], which has been around for ever. It's a single header file include, full featured, and pretty bulletproof.
[1]https://troydhanson.github.io/uthash/ https://troydhanson.github.io/uthash/
- watmough 11y agoAhhh, thanks for that. I will take a look. Definitely interested to see how other people handle some of issues with threading, hash-collisions etc., and also how to best build code that'll run out of a single header file.
- watmough 11y agoYes, there's definitely some stuff in there I hadn't thought of like how to handle strings as char[xxx] vs string ptrs. Thanks.
- jasonjei 11y agoIt's funny, because while I remember I was forced to implement one back in my CS days, I questioned the point and practicality of it (as I did with other things like in the OS class). But I am thankful now for having been put through the exercise (as well as competitive grading, based on the average runtime with random hashtables constructed). Knowing how a hash table is implemented allows you to understand why it's an efficient structure.