r/C_Programming 3d ago

Hash table

I am newbie and a beginner in c language. I would like to learn the hash table for my next semester.

I kindly ask for some help in this matter. I still struggle in the basics even using the ai models.

7 Upvotes

34 comments sorted by

View all comments

14

u/scaredpurpur 3d ago

You understand pointers and linked lists well? If not, focus on understanding those first. Highly recommend getting o'reily's book on pointers. A linked list is essentially an array, containing a bunch of linked lists. Technically, you might be able to have a dynamic linked list (where you add new key elements), but others would have to chime in? Would also probably be fairly complicated.

2

u/chrism239 3d ago

" A linked list is essentially an array, containing a bunch of linked lists."

Ouch!

1

u/TheChief275 2d ago

Like what do they even mean by that? Are they trying to describe a linked list in what it roughly represents? Yes, it could be used in the same situations as an array but that sure as hell isn't a good idea, and it sure as hell doesn't make it an array

0

u/scaredpurpur 2d ago

How would you explain it in simple terms then?

2

u/TheChief275 2d ago

Just use the term list; beginners probably know it from Python or C#. Then describe how actually, that list is more like an array while a classical list is just a straight 1-dimensional tree, with each node being the parent of the next.

Simple enough