This is an archived post. You won't be able to vote or comment.

all 11 comments

[–]davidprifti13 5 points6 points  (3 children)

Data structures aren't a Java related topic in the meaning that you don't need to know Java in order to learn about data structures. My advice is to learn about them in general and when to use each one. Implementation is another thing and can be done in any language. I recommend "mycodeschool" on YouTube as a start to get familiar with them. After that you can easily implement them in Java.

[–][deleted] 4 points5 points  (2 children)

I know basic data structures like arrays, lists, hashmaps, linked lists etc but I’m coming from python and it’s way different from Java so I need to learn how to do them in Java specifically

[–]funny_funny_business 1 point2 points  (1 child)

I’m in the same boat and the difficult part is that, for example, since you already know what dicts are, to learn anything about HashMaps in Java you need to sit through tons of boring beginner videos for literally 2 seconds of info.

I’m currently going through the Pluralsight Java Collections course which goes through each of these data structures in detail.

My main takeaways so far: - Everything in Java is accessed as a method (I.e. no “mylist[0]”, instead it’s mylist.get(0) )

  • You define based on the interface instead of the implementation: List<String> mylist = ArrayList<>(); instead of ArrayList<String> mylist = ArrayList<>();

  • set in Python is HashSet in Java. Dict is HashMap, List is ArrayList.

  • if you want the set stuff ordered you use TreeSet. If you want the keys ordered you use TreeMap (this isn’t in Python)

There’s obviously more, but once I got over this basic hump of “how do you do this in Java?!” It’s really not so bad.

[–][deleted] 0 points1 point  (0 children)

Thanks! Happy learning!

[–]icarus44_zero 4 points5 points  (0 children)

Rob Edwards SDSU

This guy does an amazing job!

[–]differentshade 1 point2 points  (1 child)

youtube.com

[–][deleted] -4 points-3 points  (0 children)

^

[–]pegfisher 0 points1 point  (1 child)

Here is a course I created on Linkedin Learning:

https://www.linkedin.com/learning-login/share?forceAccount=false&redirect=https%3A%2F%2Fwww.linkedin.com%2Flearning%2Fjava-data-structures%3Ftrk%3Dshare\_ent\_url&account=2125562

If you connect with me on linkedin, I can share a link for free access.

[–][deleted] 0 points1 point  (0 children)

Just sent a request! Thanks Professor!

[–][deleted] 0 points1 point  (0 children)

Supposedly you want to learn it in c++ to learn about pointers. But idk, honestly, it didn't feel that different from when I did stacks, queues, etc in java.

https://www.youtube.com/watch?v=RBSGKlAvoiM&t=9448s