News for hackers. Stuff that matters.
Re:A hash table by any other name by tialaramex on Friday July 26, 2024 @03:12PM (#41081381)
"I just use an array" doesn't solve the problem "What if the array is full?".

In fact it makes that problem acute. A linked list structure will degrade gradually as we shove more entries with the same hash into it, every look-up incurs a pointer chase down the entire list, slower is eventually unacceptable but we do get signs first -- but with arrays we're just screwed, in C it's pretty likely we end up with an illegal dereference or we lose data once there's no room.

Re:A hash table by any other name by mst on Friday July 26, 2024 @05:17PM (#41082359)
If it's designed to be used for caching, then replacing an old entry or throwing away the new one is quite possibly a perfectly reasonable "out."

If it's designed to be used for other purposes as well, not so much.

(I wasn't entirely sure which from reading the article)