Join 309,257 Programmers for FREE! Get instant access to thousands of experts, tutorials, code snippets, and more! There are 2,504 people online right now. Registration is fast and FREE... Join Now!
I've just started reading the following title: "Introduction to Algorithms"
After reading 30 pages it seems very detailed and technical (but definitely not something easy to understand). It also doesn't use a specific language, instead, it uses pseudocode.
For those of you that are working in the software industry how important do you think a deep understanding of algorithms is. For instance, being able to compare two algorithms and determining which one is more efficient.
When writing software do you evaluate the algorithms efficiently a lot, or do you simply try to get the desired output?
This book has over 900 pages and I don't think I can go through the entire thing.
Well, this like many things in the Comp/Sci industry is determined by what you are attempting to accomplish. If you need to get something out the door sloppy can work, but you will need to get it up to snuff in an update or later version.
Here is an (overly) general definition for algorithms:
QUOTE
Algorithm - series of instructions Algorithms are converted into programming languages, programming languages are converted into binary instructions for the computer to run
Now, Big O notation can come into play when you are looking at things such as sorth algorithms. Sure, a selection sort or bubble sort is quite capable of getting the basic job done, but a quick sort, merge sort, or flash sort can accomplish the same thing in significantly less time. Given that algorithm effenciency is one aspect of programming that should definately be taken into account (though I don't see how a book could take 900 pages to say that...).
how important do you think a deep understanding of algorithms is.
One of the most important, if not the most important skill a programmer could possess. Computer programs are nothing but a set of algorithms. Not having a deep understanding of algorithms means not having a deep understanding of your own programs.
QUOTE
For instance, being able to compare two algorithms and determining which one is more efficient.
Although you may not find yourself analyzing algorithms a lot, while working as a computer programmer, learning to analyze algorithms is a part of having a deep understanding of them. Can't really understand an algorithm without knowing which operations its performing and when, right? Furthermore, you must be able to design your own algorithms, and you cannot properly do it without performing an analysis.
Now, of course you can become yet another .NET codemonkey developing yet another .NET database application, in which case you can take that book and shove it into a fireplace - you won't need it.
I agree with Neumann and Beta, but i think it really depends on what kind of development you wanna do as Neumann said. if you wanna work for Google you will have to be freaking good at analyzing and developing your own Algorithms, I have 2 friends who go to Uni with me and they both got an internship at Google this summer because they are damn good with that Algorithm stuff. I believe every programmer should have at least some understanding of analyzing algorithms, after all its really fun to think about smart ways to do things and it ALWAYS pays off. I'm reading the same book as yourself actually
When I say "an understanding of algorithms" I don't mean, knowing what an algorithm is doing I am actually relating to understanding the efficiency of an algorithm.
You could say that everything you write is an algorithm so having an understanding of algorithms is definitely important, although this isn't exactly what I mean.
if I may interject, this wouldnt happen to be "Introduction to Algorithms" by Cormen, Leisserson, Rivest, would it? If it is, that is an excellent book. I highly recommend it to anyone..however, I also recommend "The art of computer programming" by Donald Knuth.
My point is these are excellent books that you can use to further your knowledge of algorithms and programming in general.
My suggestion for your first venture into learning algorithms is to get a book in your favorite language (say C++) on the subject of "Data Structures and Algorithms in <insert language here>"
Some good ones that i've come across are "Algorithms and Data Structures in C++" by leendert ammeraal "Data Structures in C++ : Using the Standard Template Library" by Timothy Budd -more advanced- "Data Structures, Algorithms, and Applications in C++" by Sartaj Sahni
This post has been edited by mattman059: 4 Sep, 2009 - 02:03 PM
how important do you think a deep understanding of algorithms is.
One of the most important, if not the most important skill a programmer could possess. Computer programs are nothing but a set of algorithms. Not having a deep understanding of algorithms means not having a deep understanding of your own programs.
QUOTE
For instance, being able to compare two algorithms and determining which one is more efficient.
Although you may not find yourself analyzing algorithms a lot, while working as a computer programmer, learning to analyze algorithms is a part of having a deep understanding of them. Can't really understand an algorithm without knowing which operations its performing and when, right? Furthermore, you must be able to design your own algorithms, and you cannot properly do it without performing an analysis.
This. To add onto it a bit, the ability to recognize (roughly) running time by looking at it [the algorithm] is useful as well. You can then compare various solutions you come up with with the one that balances requirements and efficiency the best.
For those of you that are working in the software industry how important do you think a deep understanding of algorithms is. For instance, being able to compare two algorithms and determining which one is more efficient.
When writing software do you evaluate the algorithms efficiently a lot, or do you simply try to get the desired output?
I work in Data Quality software and of my grad school classes, Algorithms is the one I use most often. When you are developing enterprise class software, speed matters and well designed algorithms can make your software a market leader or just another product in the category.
Being able to analyze how quickly a particular clustering algorithm, distributed sort, or graph traversal operates is very important in the software industry. And since I might be working in Java today, C++ tomorrow, Python next week and who knows what next year, being able to do so using Big-O in pseudo-code is important.
There's this quote that says: "Premature optimization is the root to all evil" and that optimization should be done when the problem is already solved and the client requests faster code.
My take is, I agree with Knuth (guy who made that statement) to some extent. Yes, worrying too much about optimization while in the process of designing is a bad thing and will most likely result in more bugs and hard-to-debug code. However, performance is still a part of the program's design, so the programmer should keep that in mind while writing the code. The key is to balance performance and design goals.
This post has been edited by Neumann: 5 Sep, 2009 - 06:10 PM
My take is, I agree with Knuth (guy who made that statement) to some extent. Yes, worrying too much about optimization while in the process of designing is a bad thing and will most likely result in more bugs and hard-to-debug code. However, performance is still a part of the program's design, so the programmer should keep that in mind while writing the code. The key is to balance performance and design goals.
+1
To add a little bit, when I'm designing an algorithm I ask myself 3 questions: what, how and why. What data structure am I using? Why am I writing this program (purpose)? And lastly, how should I solve this problem (or what mathematical structures are involved)? A lot of the time, your solutions can be found in mathematical structures, hence all the math required in CS programs.
I would have to agree with the posters before me, the ability to evaluate the efficeny of differening algorithms is a task-dependant technique. I've worked, for example, with systems that need to be quick out the door and speed is not as much of an issue and systems where speed is absoultely paramount and development time is negotiable. The classic comparission is with real-time and non-real-time applications where a pilot needs the speed and a ticket office needs the maintainability.
However, as a student I tried to get my hands on anything that I could possibily offer a potential employer because you never know what you'll be working on when your in the indurstry. It's very rare for you to be able to plan your studies and go straight in to the job you wanted.
There are also the times where two easy-to-code alternatives occur to you. It's worth being able to say this is O(n) and that is O(n^2) so I'll do the first.