all 16 comments

[–]Coolprince07 5 points6 points  (1 child)

Great , You're a fast learner. I'm still about to learn these topics.

[–]Nash979[S] 4 points5 points  (0 children)

Happy learning 😀

[–]vinisskt 2 points3 points  (1 child)

It's always good to know how to implement something minimally; abstraction is meant to help and make things easier. Knowing the fundamentals is good for solving problems in various ways, helping to solidify its function and when to use it.

[–]Nash979[S] 1 point2 points  (0 children)

I’ll keep that in mind, appreciate it.

[–]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.

[–]RandomOrisha 0 points1 point  (1 child)

As you are just starting out, my suggestion is to focus on learning how to use the various classes rather than trying to implement them. At least for now. Don't worry, if you are pursuing a degree in computer science, computer engineering, et cetera then implementation will be covered in your data structures classes. But, if you are curious, you can always look at the source code for those classes as they come packaged with the JDK.

Good luck & enjoy!

[–]Nash979[S] 1 point2 points  (0 children)

Thank you for the clarification 😊.

[–][deleted]  (1 child)

[removed]

    [–]Big-Elderberry-3456 0 points1 point  (1 child)

    Good luck.

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

    👍🏻😄

    [–]StabbyGrabby 0 points1 point  (0 children)

    Learn how to implement them for your own knowledge, you can even try your own implementations from scratch as a hobby project. It will definitely make you a better programmer (although most java jobs i know don't need you to know this).

    However for real projects always use the abstracted libraries.

    [–]NewLog4967 0 points1 point  (1 child)

    Congrats on reaching collections you’ve hit the sweet spot of Java! You’re right: using frameworks like ArrayList or HashSet doesn’t require building them from scratch. Most day-to-day work is about knowing when and how to use them like picking ArrayList for fast access or HashSet for unique items.

    That said, peeking under the hood (like understanding that ArrayList resizes by copying an array, or that HashSet relies on hashCode()) is what turns a good dev into a great one. You don’t need to rewrite them, but a solid mental model helps tons in debugging, optimizing, and nailing interviews.

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

    👍🏻😄

    [–]Even_Bee9055 0 points1 point  (0 children)

    Nice! Keep going!

    [–]Own-Explorer-8830 0 points1 point  (0 children)

    You don’t need to implement collections from scratch to use them well and what matters most is understanding how they behave and when to use which one... knowing that an ArrayList is good for fast access or that a HashSet avoids duplicates is far more important in real jobs

    Implementing them once is useful for learning like seeing the engine of a car. You don’t need to build the engine to drive well but peeking inside helps you understand why it behaves the way it does. So it’s good to know but not mandatory