MIT License

项目介绍

jamesroutley/write-a-hash-table 是一个托管在 GitHub 上的开源项目,采用 MIT License 许可证,目前获得 4.3k 个 Star、328 次 Fork。

仓库全名
jamesroutley/write-a-hash-table
开源许可证
MIT License
Star 数
4.3k
Fork 数
328
未关闭 Issue
27

README 摘要

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…

完整内容见 GitHub 原始 README 或本页 。

常见问题

write-a-hash-table 可以免费商用吗?

仓库采用 MIT License 许可证,可免费使用与修改,商业使用请遵守许可证条款(例如保留版权声明与许可声明)。

如何获取 write-a-hash-table 的源码?

可以直接克隆仓库:git clone https://github.com/jamesroutley/write-a-hash-table.git;安装与运行步骤见仓库 README。

write-a-hash-table 最近还在维护吗?

仓库最近一次更新为 2023年12月16日,当前有 27 个未关闭 Issue;Star 数为 4.3k,可作为社区活跃度的参考。

简要分析

热度分
9310
价值分
3125
活跃状态
活跃

Release

README

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

  1. Introduction
  2. Hash table structure
  3. Hash functions
  4. Handling collisions
  5. Hash table methods
  6. Resizing tables
  7. Appendix: alternative collision handling

Credits

This tutorial was written by James Routley, who blogs at routley.io.

评论

暂无评论