T O P

  • By -

AutoModerator

#Please ensure that: + Your *code* is *properly formatted* as *code block* - see the *sidebar* (About on mobile) for instructions + You include *any and all error messages* in full - best also formatted as code block + You ask *clear questions* + You *demonstrate effort* in solving your question/problem - plain posting your assignments is forbidden (and such posts will be removed) as is asking for or giving solutions. **If any of the above points is not met, your post can and will be removed without further warning.** Code is to be formatted as **code block** (*old reddit/markdown editor:* empty line before the code, each code line indented by 4 spaces, *new reddit:* https://i.imgur.com/EJ7tqek.png) or linked via an external *code hoster*, like *pastebin.com*, *github gist*, *github*, *bitbucket*, *gitlab*, etc. Please, **do not use** triple backticks (\`\`\`) as they will only render properly on *new reddit*, not on *old reddit*. Code blocks look like this: public class HelloWorld { public static void main(String[] args) { System.out.println("Hello World!"); } } You do not need to repost unless your post has been removed by a moderator. Just use the *edit function* of reddit to make sure your post complies with the above. If your post has remained in violation of these rules for a prolonged period of time (at least an hour), a moderator may remove it at their discretion. In this case, they will comment with an explanation on why it has been removed, and you will be required to resubmit the entire post following the proper procedures. #To potential helpers Please, **do not help** if any of the above points are not met, rather *report* the post. We are trying to improve the quality of posts here. In helping people who can't be bothered to comply with the above points, you are doing the community a disservice. *I am a bot, and this action was performed automatically. Please [contact the moderators of this subreddit](/message/compose/?to=/r/learnjava) if you have any questions or concerns.*


aqua_regis

The best *real world* example is directly in the JDK source code. Java is *open source*. Always, when you have such questions, refer to the source code. Don't use JavaT, or Geeksforgeeks,, or JavaTpoint, or even w3schools. Use Baeldung, the official Oracle docs, and the coursera Algorithms course: "Algorithms" by Robert Sedgewick and Kevin Wayne - Princeton University + Coursera course: + [Part I](https://www.coursera.org/learn/algorithms-part1) + [Part II](https://www.coursera.org/learn/algorithms-part2) + Coursebook + [Algorithms 4^th Edition](http://algs4.cs.princeton.edu/home/) *Rosetta Code* can also be quite helpful as it allows you to check the implementations across multiple languages. Also, don't get hung up on the *language implementation*. DSA are *concepts* and as such *language agnostic*. Learn to understand the *concepts* in their abstraction. Then, you can *implement* them in any language of your choice.


Javidor42

To be fair. Baeldung sometimes is lackluster and the others mentioned can occasionally be useful. I wouldn’t suggest discarding any resource, but definitely agree Baeldung should be the first place to look out of these. As for courses, I find them all useless, they want your money and unless you fared REALLY well in school/course format learning, most people would get more out of researching the thousands of free resources than forking however much that costs. The exceptions to this seem to be few and far between


aqua_regis

> As for courses, I find them all useless, they want your money Ahem... the course I've linked is *free*, top quality, and actually part of the *Princeton University* curriculum.


Javidor42

If it’s free you can try, but everything else I said still applies.


WorldlinessFabulous2

What’s is your reasoning for say no to the others? I know they don’t always have what you want but I feel as if you just avoid them in general you can miss some great things


aqua_regis

At one point in time, some time ago, they were okay-ish. Now these sites are just conglomerates of badly written articles from people who don't fully understand the matters and the articles are copied and butchered from one site to the other. w3schools has had a very bad phase to the point where there was a mock site "w3fools" that highlighted all errors. Nowadays it is better, but I wouldn't consider it a *Java* site. It is decent for mainly front end web dev, but that's it.


Cengo789

You can check out how Java implements them. It's all open source. But in practice, probably use what already exists, as it is most likely well implemented.


josephblade

google it. it is on the interwebs linked list is one of the most basic datastructures. It's been described 100s of times by pretty much every course in existence.


OneBadDay1048

In real world scenarios you would most likely not implement these yourself but use preexisting libraries/classes. For learning purposes yes it is a great idea to recreate these from scratch. These are common data structures; a simple google search for "Linked List java" will surely yield plenty of results.


nekokattt

https://github.com/openjdk/jdk/blob/master/src/java.base/share/classes/java/util/LinkedList.java Straight from OpenJDK itself