‹ BackHN Continuity

Thread

Needed 1+1, built a functional programming language

151 points · 80 comments · birdculture

  1. ancientstraits · · focus · HN ↗
    The &quot;how to implement a hash table&quot; article <a href="https:&#x2F;&#x2F;benhoyt.com&#x2F;writings&#x2F;hash-table-in-c&#x2F;" rel="nofollow">https:&#x2F;&#x2F;benhoyt.com&#x2F;writings&#x2F;hash-table-in-c&#x2F; was really helpful for me. I thought that hash tables were something that were basically impossible to make in C, but this showed that it was simpler.
    1. fuzztester · · focus · HN ↗
      IIRC, the first edition of the book &quot;The C Programming Language&quot; (aka K&amp;R), by Kernighan and Ritchie, had a simple example of how to create a hash table in C, including with buckets to handle collisions. It was a simple algorithm. It simply added up the ASCII values of all the characters in the key, modulo some number.
Open on Hacker News to reply ↗

Unofficial Hacker News client; not affiliated with Y Combinator.