Take the 2-minute tour ×

I am a beginner to programming. Should I learn data structures and algorithms, and the programming language Java side by side? Now that I know data structures and algorithms form the basis of programming. Should I learn them first?

I am confused. What should be my learning path?

I want to be a really good Java programmer.

share|improve this question

closed as not constructive by casperOne Jan 28 '12 at 21:16


See also stackoverflow.com/questions/2786995/… posted by same user. –  anon May 8 '10 at 8:01
add comment

8 Answers 8

up vote 5 down vote accepted

My recommendation:

1.) Learn the basics

Learning the Java Language

(excluding the Generics chapter, this is more of an advanced topic)

2.) While learning the basics, practice your gained knowledge by solving simple exercises

Coding Bat

3.) Start implementing simple algorithms, learn how to use recursion

  • Bubble Sort (only for practice, don't ever actually use this)
  • Insertion Sort
  • ...

4.) Grab a good book about Data Structures and Algorithms and start learning them

share|improve this answer
Binary Search is such an algorithm that looks extremely simple but is difficult to implement correctly. I don't think it should be in "simple algorithms"; I have seen my share of incorrect implementations in production code. –  Ritsaert Hornstra May 8 '10 at 19:45
@Ritsaert You're absolutely right. When I first implemented it for an assignment, I also got it wrong ;-). –  helpermethod May 10 '10 at 9:17
Bubble sort can be useful in practice of a dataset is small imho but +1 for it as it's really great starting point –  lukas.pukenis Feb 14 at 12:29
add comment

I think it's fine to learn the two side-by-side. If you try to just learn the data structures and algorithms first without doing any programming, it will all be a bit abstract - I think you're likely to learn more effectively if you can use what you're learning in a practical context. It also means you can experiment with what you're learning... it's harder to experiment in a theoretical way.

share|improve this answer
okay..thanks for answering :) –  Serenity May 8 '10 at 7:13
add comment

I think that you should learn only the very basics of java, then begin to learn about data structures and algorithms side by side with some more advanced java. If you start looking into things like algorithms without learning at least some language constructs, things are going to be hard to grasp.

share|improve this answer
add comment

Often we programmers never learn to be good programmers.

The language we jump into first has too much influence on how we think about problems. Later, we may learn other languages but we continue to write programs as though we were using the first.

Our horizons are clipped by that start language (e.g. Java) or paradigm (e.g. object oriented).

Although we sense we are lacking something, we are too busy fighting alligators to drain the swamp that bogs us down.

My advice is don't jump into Java, or anything else too quickly. Expose yourself to a progression of languages right from the start. You'll end up a better Java programmer.

This is a really good path to follow:


share|improve this answer
add comment

I would personally reccomend you learn Java, although most programming languages will do. Although Algorithms and Data Structures are an important part of programming, they are not the only one. It is useful to be familiar with a programming language when studying any subsection of the software engineering realm, such as A.I. or Data Structures, as it gives you a deeper understanding of the inner workings of the algorithms. It is important to be able to read pseudocode and translate it into actual working code.

The Sun Tutorials are great as they cover a large amount of material, both beginner (see the Language Basics section) and advanced.

This free online Java Textbook is great as it can be viewed online, or offline by downloading a free PDF version.

I would then recommend some practice to fully grasp the language, either by working on some small personal projects (simple text games, utilities, etc.) or by studying some open source code. Sourceforge is great for this.

Also, if you enjoy mathematics, Project Euler is an excellent way of learning Java (or any other language as the challengs can be solved in any language). This will also help you develop the skills necessary to work with algorithms and solve them.

Once you feel you have a good grasp of your language of choice, moving on to Algorithms and Data Structures will not only be easier but more enjoyable. Your ability to translate pseudo-code into working code will come in very useful as you can truly understand the workings of the algorithms and data structures and can implement them in test applications.

share|improve this answer
add comment

Most data structures books are going to be rooted in some programming language. I would suggest finding one that uses Java and go from there. That being said, DS and algorithms are great, but those alone won't make you a 'really good Java programmer'.

Here's a link to a Google Shopping search for Java data structures books. I'll date myself by saying that I've never read any of them, and the DS book I read in college was written for C.

You should also have a look at the Pragmatic Bookshelf (Google it, I can't paste multiple links with my low rep) as well, they have books about the craft of programming, rather than just languages. Very handy indeed.

share|improve this answer
add comment

Definitely my recommendation is to learn algorithms first and data structures after....and then a programming language like Java. I talk by my experience.

share|improve this answer
add comment
