3 ms·
Good catch! Yes, that looks like a bug :)
by e-dant 2y ago
Good catch! Yes, that looks like a bug :)
- attractivechaos 2y agoYou are implementing a closed hash table with linear probing. You need tombstones to mark deleted items, or better, move other items to replace deleted items [1]. Currently your library doesn't have either mechanism. [1] https://en.wikipedia.org/wiki/Linear_probing#Deletion https://en.wikipedia.org/wiki/Linear_probing#Deletion
- munificent 2y agoIf it helps, my book Crafting Interpreters walks through a linear probing hash table implementation in C including handling deletion: https://craftinginterpreters.com/hash-tables.html#deleting-entries https://craftinginterpreters.com/hash-tables.html#deleting-e...