Skip to content
0:00 / 0:00

#hashtable#hashing#c

Understanding and implementing a Hash Table (in C)

Jacob Sorber

195K subscribers • 5 videos on Hallway

YouTube
  • Recommended by 2 people: 2 in engineering communities.
  • Presented by Jacob Sorber

Beginner. No background in the topic needed.

446K views6 years ago2 recommendations

Computer scienceProgramming languagesData structuresCAlgorithms

Jacob Sorber explains the fundamentals of hash tables and demonstrates how to implement one from scratch in C.

Patreon ➤ patreon.com/jacobsorber Courses ➤ jacobsorber.thinkific.com Website ➤ jacobsorber.com --- Understanding and implementing a Hash Table (in C). //. What is a hash table, and how do I implement one? Hash tables are a fundamental data structure that all student programmers need to have in their toolbox. This video describes the basics of hash tables, why they're useful, and how you implement them in C. Related Videos: Linked lists: youtu.be/VOpjAHCee7c Doubly-linked lists: youtu.be/KFbm6lkMhgw Modulus operator: youtu.be/gNEZHW5-Wso *** Welcome! I post videos that help you learn to program and become a more confident software developer. I cover beginner-to-advanced systems topics ranging from network programming, threads, processes, operating systems, embedded systems and others. My goal is to help you get under-the-hood and better understand how computers work and how you can use them to become stronger students and more capable professional developers. About me: I'm a computer scientist, electrical engineer, researcher, and teacher. I specialize in embedded systems, mobile computing, sensor networks, and the Internet of Things. I teach systems and networking courses at Clemson University, where I also lead the PERSIST research lab. More about me and what I do: jacobsorber.com people.cs.clemson.edu/~jsorber/ persist.cs.clemson.edu/ To Support the Channel: + like, subscribe, spread the word + contribute via Patreon --- [patreon.com/jacobsorber] + rep the channel with nerdy merch --- [teespring.com/stores/jacob-sorbers-store] Source code is also available to Patreon supporters. --- [jsorber-youtube-source.herokuapp.com/]

Why it's here

2 people recommend this

What people say. Recommended as a great video for learning how to implement and understand hash tables in C.

Moments people linked to

u/Skopjanecotin r/C_Programming • Recommends

Question regarding deleting nodes from hash tables I am learning about hash tables at the moment and follow examples of how they are implemented. Jacob Sorber has a great video on this topic and I followed it, typed it, tried to understand how it works. It went fine and had no issue in grasping what was implemented until the very end when he edits a function which removes nodes from a hash table. // Deletes a person from the hash table person *hash_table_delete(char *name) { int index = hash(name); person *tmp = hash_tableindex; person *prev = NULL; while (tmp != NULL && strcmp(name, tmp->name) != 0) { pre…
11View on Reddit

u/DeeBoFour20in r/C_Programming • Recommends

…ning the int and the string. I could just iterate through the array every time I need to do a lookup but that seems less efficient than using a hash map (or maybe it's not? I have \~7000 elements in the array.) I've used hash maps before in Java so I understand how to use them but I've never implemented one from scratch. I watched this video ([video and understand the gist of it but he kind of glossed over the hash function (the one he uses is probably not optimal and won't work for ints anyway.) Can anyone give me some tips on how to write a good hash function? And at what point is a hash map worth using? With 7000 elements, am I better off just iterating through an array? With my…

u/Dgeezuschristin r/C_Programming • Mentions

On “Want to learn hash table in C”

Jacob sorber on YouTube is awesome. I think there’s two or three videos. Here is the first: link to this video

u/TiagoPaoliniin r/C_Programming • Mentions

On “Hash tables. When do I implement and use them?”

…table, you search all keys on the resulting index until you find the correct one. Ideally, the size of the array should be big enough to minimize the amount of collisions. Because if too many happen the hash table won't be much better than just searching each key one by one. Here are a couple of videos that go step by step on making a hash table: link to this video link to this video If you are unsure on which hash function to use, and you don't need a "cryptographically secure hash", I recommend the FNV-1a. It's quite easy to implement and it's quite fast.…

u/Migazul8in r/C_Programming • Mentions

On “Hash table”

I really enjoyed this video link to this video

u/aghast_njin r/C_Programming • Mentions

On “What to learn next after data structure?”

Try this guy: [video He's a college professor, and has a bunch of "bite sized" videos up on youtube. He talks pretty fast, so you might benefit from setting the video Playback Speed to 0.75, at least during some parts.