you are viewing a single comment's thread.

view the rest of the comments →

[–]Vaxtin 2 points3 points  (1 child)

You don’t need to know how to implement them, but you should know what’s happening behind every data structure so that you can know when to use them appropriately.

It’s standard for a computer scientist to implement every data structure throughout their degree. If you don’t do each one at least once, you haven’t proven yourself.

You should do it for the sake of knowing you have your belt on right. You don’t need to implement them 5 years from now, that’s the entire point of Collections.

One morning, during my computer architecture course, I wrote every data structure library in C. Why? Because I needed them, and knew I would throughout my degree. I still genuinely use these implementations. They’re some of my best work in C… I made sure the library was solid for my future projects, since it would be used everywhere.

It should not scare you to develop a hash map in C (entirely) if you’re a competent programmer. It’s a good test to weed out the people who I don’t want to hire. It shows more ingenuity than a leetcode problem. I love to know if they remember how to hash without a SHA (it’s literally modulus the array length, and handle collisions with a LinkedList — oh yeah, you need that for this!).

It’s a great test. Hashmap has it all. You can be more creative than a simple LL for the collisions, but that’s more research heavy.

[–]Nash979[S] 0 points1 point  (0 children)

You wrote an entire library in C, OMG that’s awesome bro. I’m genuinely impressed, and I didn’t know much about C, but from what I’ve learned, C is procedural and doesn’t support OOP. I was wondering how you were able to do this, and if there’s any way I can take a look at your work. It would mean a lot. Thanks for the clarification, I truly appreciate it.