jamesroutley/write-a-hash-table
jamesroutley/write-a-hash-table has 4,401 GitHub stars and 332 forks. GitHot measured -1 stars in 24 hours, +1 in 7 days, and +1 in 15 days. Last checked 2026-11-20 02:42 UTC. Last push 2023-12-16.
計測したスター増加
- 24時間
- -1
- 7日間
- +1
- 15日間
- +1
- 1か月
- 履歴を収集中
期間ごとの純増数です。期間は重複しており、日別の値ではありません。未計測の値は空欄です。スター数は注目度の指標であり、品質の保証ではありません。
概要
✏️ Learn how to write a hash table in C
学習README.md
オリジナルWrite a hash table in C
Hash tables are one of the most useful data structures. Their quick and scalable insert, search and delete make them relevant to a large number of computer science problems.
In this tutorial, we implement an open-addressed, double-hashed hash table in C. By working through this tutorial, you will gain:
- Understanding of how a fundamental data structure works under the hood
- Deeper knowledge of when to use hash tables, when not to use them, and how they can fail
- Exposure to new C code
C is a great language to write a hash table in because:
- The language doesn't come with one included
- It is a low-level language, so you get deeper exposure to how things work at a machine level
This tutorial assumes some familiarity with programming and C syntax. The code itself is relatively straightforward, and most issues should be solvable with a web search. If you run into further problems, please open a GitHub Issue.
The full implementation is around 200 lines of code, and should take around an hour or two to work through.
Contents
- Introduction
- Hash table structure
- Hash functions
- Handling collisions
- Hash table methods
- Resizing tables
- Appendix: alternative collision handling
Credits
This tutorial was written by James Routley, who blogs at routley.io.

