Skip to Main Content
Learn C the Hard Way: Practical Exercises on the Computational Subjects You Keep Avoiding (Like C)
book

Learn C the Hard Way: Practical Exercises on the Computational Subjects You Keep Avoiding (Like C)

by Zed A. Shaw
July 2015
Intermediate to advanced content levelIntermediate to advanced
380 pages
10h 15m
English
Addison-Wesley Professional
Content preview from Learn C the Hard Way: Practical Exercises on the Computational Subjects You Keep Avoiding (Like C)

Exercise 38. Hashmap Algorithms

There are three hash functions that you’ll implement in this exercise:

FNV-1a Named after the creators Glenn Fowler, Phong Vo, and Landon Curt Noll, this hash produces good numbers and is reasonably fast.

Adler-32 Named after Mark Adler, this is a horrible hash algorithm, but it’s been around a long time and it’s good for studying.

DJB Hash This hash algorithm is attributed to Dan J. Bernstein (DJB), but it’s difficult to find his discussion of the algorithm. It’s shown to be fast, but possibly not great numbers.

You’ve already seen the Jenkins hash as the default hash for the Hashmap data structure, so this exercise will be looking at these three new hash functions. The code for them is usually small, and it’s ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Modern C for Absolute Beginners: A Friendly Introduction to the C Programming Language

Modern C for Absolute Beginners: A Friendly Introduction to the C Programming Language

Slobodan Dmitrović

Publisher Resources

ISBN: 9780133124385Purchase Link