Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

I just finished the data structures and algorithms course in school , I took it during the summer so 6wks course vs a 16 wk course during the regular semester. So not only was the course hard but it was really really really fast. My question is what do I need to know about data structures in the real world? I understand what they do and how they work, for the most part, but I had a real tough time coding them , I wouldn't be able to write the code for a binary tree class or a balanced tree class from scratch .... Is that bad? should I retake it , or is knowledge of how they work sufficient, without being able to write the classes from scratch?

share|improve this question
    
Do you understand that some are better than others for certain operations and in general why? –  Telastyn Jun 29 '13 at 1:45
1  
This question has been asked many ... many ... many times. Summary of the standard answer: Depends on the job. It is rare that you would need to implement one from scratch, but sometimes these things happen. It's important to know what they are and what they do so you can use them at the appropriate time. If you passed the class with a good grade, I would not retake it. –  Stargazer712 Jun 29 '13 at 4:11
    
possible duplicate of Should I keep investing into data structures and algorithms? –  Doc Brown Jun 29 '13 at 7:27
    
@Stargazer712: True, it is rare that you have to implement a binary tree at work, but you probably will have to implement other data structures that are even more complex: not all the data structures that we need come in pre-packaged libraries. –  Giorgio Jun 29 '13 at 9:38
add comment

closed as too broad by user61852, Doc Brown, BЈовић, GlenH7, MichaelT Jun 29 '13 at 14:49

There are either too many possible answers, or good answers would be too long for this format. Please add details to narrow the answer set or to isolate an issue that can be answered in a few paragraphs.If this question can be reworded to fit the rules in the help center, please edit the question.

2 Answers

Yes, you need to know about data structures and algorithms. They are the fundamental building blocks of programs. Anyone can learn the syntax of a programming language, but to actually write meaningful programs, you have to understand how to use data structures and algorithms.

Luckily, you won't be implementing these data structures usually, since there are libraries for them in every language. So no, just because you had a hard time writing a self-balancing tree doesn't mean you're going to fail as a programmer. But learning to solve hard problems in code is a very useful skill, so take every opportunity you can to develop that skill. That includes writing self-balancing trees. :)

share|improve this answer
    
thanks for your answers everyone, the class was just so fast , i just could not keep up... my teacher evern suggested i retake , it I have a decent grade , but , to be honest i dont care about the grade i want the knowledge.... like i said I understand about how they work, but writing some of them from scratch is a problem, but I am a beginner , ill just keep reading and playing with stuff in java.. –  Ray T Champion Jun 29 '13 at 12:29
add comment

A typical programmer generally doesn't need to be able to write data structures and algorithms from scratch, he/she just needs to know the strengths and weaknesses of those they do use from whichever API.

"typical" and "generally" are the important words here - sometimes the available APIs don't provide the required data structure or algorithm, sometimes the task requires a really complex data structure or algorithm not typically found in a common API and some programmers regularly perform tasks that require the use of more complex data structures and algorithms. Except for the latter case, you should be fine just copying-and-pasting / slightly modifying code found on the internet.

That said, a binary tree is not a complex data structure, so I'd be a little concerned if I were you. Any programmer should be able to code one up successfully (though I'm not sure how many would actually be able to). However, it sounds like you're reasonably new to programming, so don't worry too much. The knowledge will come, as long as you keep programming and learning about programming.

A balanced tree is more about memorizing some rules to keep it balanced, so I wouldn't worry about that one too much.

share|improve this answer
    
"A typical programmer generally doesn't need to be able to write data structures and algorithms from scratch, he/she just needs to know the strengths and weaknesses of those they do use from whichever API.": I disagree: as soon as you have to model even a simple business domain, you might have to design and implement some data structure yourself, unless all of your business logic can be expressed with standard data structures that you can find in your libraries. –  Giorgio Jun 29 '13 at 9:39
    
@Giorgio If you're talking from industry experience (as opposed to a student / non-professional programmer), maybe you're one of these then - "some programmers regularly perform tasks that require the use of more complex data structures and algorithms". –  Dukeling Jun 29 '13 at 10:48
    
Yes, I have almost 10 years experience in the industry (in two different companies) and before that I was doing other programming jobs: I need to implement new data structures all the time. I am not 100% sure if how relevant (statistically) my experience is, but I think most programmers will need to write their own data structures sooner or later, unless they have another programmer in the team who can do it for them, or the logic of their program is really trivial. –  Giorgio Jun 29 '13 at 11:49
add comment

Not the answer you're looking for? Browse other questions tagged or ask your own question.