Thread: Can most computer science problems be solved using data structures and algorithms?

1. Can most computer science problems be solved using data structures and algorithms?

Since most computer science degree programs teach data structures and algorithms, but do not necessarily go beyond these topics, does this mean that most essential programs can be solved using the essential algorithms taught in a computer science curriculum?

2. It seems to be that you are asking two different questions, one in the title of your post, and one in the body of your post:
• Can most computer science problems be solved using data structures and algorithms?
• Can most essential programs can be solved using the essential algorithms (and data structures) taught in a computer science curriculum?

What are "essential programs"?

3. Essential programs are any sort of application written by computer programmers. Why I ask if computer science problems can be solved with data structures and algorithms, is because I presume computer science is learned to manipulate and write code to a machine for the purpose of creating some kind of computer application. While computer science can be broader than that, I really mean computer science for the purpose of composing computer code.

4. And if data structures and algorithms taught in a computer science program provide you with the essential knowledge to write computer code for general applications. In other words, does a computer science program provide a computer programmer with the essential knowledge of algorithms necessary to solve most types of computer programming problems? And please note that I understand software engineering and what it is, so I realize that it is apart of designing a computer program. But are the general algorithms taught in a computer science program sufficient to solve many types of computer programming problems? Why are algorithms and data structures such an essential part of a computer science program? Does algorithms and data structures provide you with the essential knowledge to manipulate a computer to generate applications you design?

Just looking for insight at the moment. I'd like to spend more time studying algorithms and data structures, but I'd also like to know why they are so important, and to what extent my computer programming questions can be solved by better understanding algorithms and data structures.

5. If you're asking "Will a computer science degree alone fully prepare me for any program I will ever need to write?" then the answer is a resounding "No." You need to continue to educate yourself on languages, design patterns, libraries, frameworks, and yes, also data structures and algorithms. A computer science degree isn't really about programming computers. It's about understanding how to process information. Computer science is about programming computers, in the same way that cooking is about how to operate an oven.

There are far more algorithms and data structures than anyone could reasonably hope to learn and be proficient in all of them.

> But are the general algorithms taught in a computer science program sufficient to solve many types of computer programming problems?
Generally yes. But given that things like C++ STL already provides efficient implementations for searching and sorting, the need to be able to hand-craft such things from scratch is less important nowadays than it once was.

Mostly your education should be giving you the mental tools to be able to do your own evaluation and research when the need arises, and not be able to recite "quicksort" like some kind of parrot.

Vectors, lists, trees and maps get you a long way nowadays. You're not likely to be asked to solve say the knapsack problem in the average work environment, but you should have the background to recognise that there may be better approaches than brute-force.

Your employer will care that your "efficiency" is producing good code which meets it's performance objectives within a reasonable development time. Performance bottle-necks in complex systems always come from "out of left field". Get something working, then optimise it - not the other way round.

7. Hmm, not sure if I understand yet. I'm going to read through The Art of Computer Programming. I was thinking that this series of books, which encompasses the major aspects of programming algorithms would give me the insight necessary to understand all or most of my programming questions in the future (if that makes sense). I realize that there is more to programming then merely writing algorithms, but I am curious to see if a full understanding of algorithms will allow me to think correctly about most types of programming problems that I will face in the future.

I mean, understanding the algorithms to write most types of computer programs (outside of applications like game programming which would require in some cases knowledge of physics where applicable), must be finite in its scope. In other words, you don't need to have a phd in computer science to become a successful programmer. Nor do you need a degree in mathematics or physics or quantitative analysis to become a successful programmer.

So I would assume that the algorithms taught in a computer science program would give you enough knowledge so you would be able to flexibly think about programming and to help start your career as a successful programmer. Although I realize that long term success as a programmer may require life long learning, or that there is always more to learn. But I will only know the answer to this question by furthering my study of algorithms I think.

8. Originally Posted by Elkvis
If you're asking "Will a computer science degree alone fully prepare me for any program I will ever need to write?" then the answer is a resounding "No." You need to continue to educate yourself on languages, design patterns, libraries, frameworks, and yes, also data structures and algorithms. A computer science degree isn't really about programming computers. It's about understanding how to process information. Computer science is about programming computers, in the same way that cooking is about how to operate an oven.
And when I speak of this subject matter, I'm not really referring to software engineering paradigms or libraries and templates. I mean does the general area of data structures and algorithms (and quite possibly other subject areas of computer science) give you the tools necessary to think through most types of programming problems?

As such, why does the series of books in The Art of Computer Programming not go over any sorts of specific material not taught in the field of computer science? I mean, the primary concepts in The Art of Computer Programming are all things taught in a computer science program, such as linked lists, data structures, searching, sorting, compiler design, numerical analysis etc. And this series of books is meant to teach you the main theories of computer science needed to write computer programs, so it must try to cover all essential aspects of algorithms needed to write computer programs. Or to put it another way, computer science related to the art of programming must be finite in its scope, and the most important theories could be covered in the span of a couple of books. Is my thinking correct here?

9. Originally Posted by Terrance
The Art of Computer Programming
Note that this series includes "unsolved research problems".

Originally Posted by Terrance
The Art of Computer Programming not go over any sorts of specific material not taught in the field of computer science?
The series doesn't cover every aspect of programming or math. I'm not aware if the series includes anything about operating systems that deal with multi-threading / multi-processing / virtual memory / ... . Math and physics have a lot of specialties, like finite field math, or orbital mechanics.

10. In Herbert Schildt's book, C The Complete Reference 4th Edition, the beginning of the section on linked lists and other data structures, he specifically says that programs consist of data structures and algorithms. Thus, this answers my question, or at least is the best answer to my original question, which is that all programs are some mixture of algorithms and data structures.

11. Originally Posted by Terrance
In Herbert Schildt's book, C The Complete Reference 4th Edition
Generally, you should be wary of Herbert Schildt's books: while these books often receive positive reviews by beginners on sites like Amazon, they tend to be disdained by reviewers who have expertise in the relevant subject matter for their manifold technical errors. For this particular book, I see that a reviewer at ACCU has given a less scathing review than is usual (and while I would not claim to be an expert at C and C++, even with my level of knowledge and skill I can verify the assertions of these reviewers for those of Herbert Schildt's books that I have read), but I would still approach it with caution.

Originally Posted by Terrance
the beginning of the section on linked lists and other data structures, he specifically says that programs consist of data structures and algorithms. Thus, this answers my question, or at least is the best answer to my original question, which is that all programs are some mixture of algorithms and data structures.
I'd say that while all programs eventually can be reduced to some combination of algorithms and data structures, they do not necessarily explicitly consist of algorithms and data structures. Herbert Schildt's claim essentially assumes an imperative programming paradigm, but consider say, a possible Prolog program.

12. Originally Posted by Terrance
Thus, this answers my question, or at least is the best answer to my original question, which is that all programs are some mixture of algorithms and data structures.
Rather than just look for a hard yes or no, I think it would be a good thought experiment to ask "what else is there?" We know that algorithms are a thing, and data structures are a thing. They're both used in programs, but can we boil all concepts of a program down to either one or the other? In my opinion that's a healthier approach, since the art of programming is more of a life-long research project than just a collection of canned answers.

13. Originally Posted by Terrance
Or to put it another way, computer science related to the art of programming must be finite in its scope, and the most important theories could be covered in the span of a couple of books. Is my thinking correct here?
Computer science is tasked with an understanding of governing principles (at least most the CS you'd take on an university course). Explaining the basic data structures and algorithms can be done in a single book. You don't need a series of them. However it won't get you any closer to a mastery of Computer Science, be it for the practical or artistic purposes of programming. The "Art of Computer Programming", a series of books tasked at describing an infinitesimal part of Computer Science, is called so not because it defines the fundamental data structures and algorithms known to us. Neither is is a series of books instead of just one book because there are a lot of definitions to be made. The Art of Computer Programming is called so (and takes more than one book) because beyond the definitions, it goes on to carefully analyze each and one of them and in the process invite us to understand why these fundamentals of computer programming are just simple building blocks from which endless other data structures and other algorithms can be born.

Since before Knuth, we know that programming is, beyond a short list of communal fundamental structures, domain-based. And each problem-domain carries with itself its own set of fundamental structures and algorithms. Some they may share with other problem-domains, others are exclusive to a single problem-domain. As we delve into new fields where we put computer science to practice (AI, robotics, biological computation, quantum computing, etc), we expand Computer Science research possibilities. So there's nothing finite about Computer Science.

And if Computer Science isn't finite, necessarily the art of computer programming is a much bigger infinity (thank you Cantor, to allow me to say this with a serious face).

And you must understand Knuth book explains data structures and algorithms for a well known computer architecture. New computer architectures may obsolete all that knowledge in a single blink of the eye. Do you think that true quantum computers or biological computers of the future you will require hash tables or be performing merge sorts? Probably not. The act of programming both builds and rides this innovation. And that is its art. And you become an artist the moment you realize the building blocks can be shaped into your will on an infinite number of new data structures and algorithms which can serve as solutions to particular problem-domains in specific fields of computing. Or go even deeper than that and support entire new computer architectures.

14. I realize that computer science is a complex subject, and everything about computer science could not possibly be covered in a few books. But rather, my reasoning is that the necessary topics of computer science are generally covered in a computer science program, and a computer science degree does well in the sense that it prepares you to be a life long programmer. So rather than say that all topics of computer programming might be covered over the span of (x) number of books, what I mean is do you think the necessary concepts required to be a successful programmer can be covered in the scope of several books, as The Art of Computer Programming seemingly tries to do?

Or if you want a more direct question, if one were to master the concepts in the books of The Art of Computer Programming, would that significantly prepare them for a career in computer programming?

Again, I've studied many subjects, and many of the most important concepts of subjects can be boiled down to a single book. Take the area of finance for example. The topics of finance are very broad, if you include computational/mathematical finance, but the core concepts of finance can generally be presented in a single college textbook.

This tends to be similar in computer programming. A full language is presented within the context of a single book. This book will tend to include the language's syntax, libraries, functions, etc. Then these books will include data structures and algorithms. Then the book will cover specialized topics, such as AI, databases, web programming etc. This seems to be the structure of many of the Deitel and Deitel books (at least the older ones). And this is also the structure of computer programming courses in a computer science department. A computer science curriculum will start off with intro to CS, which may teach Java, c++, or other languages. Then a CS curriculum will offer compiler design, computer architecture, linear algebra, physics, data structures, etc. So many CS programs match each other in their course offerings. Then once you complete the core, you may be offered advanced courses such as software engineering, and other advanced topics. So the topics of computer science are to some extent finite, and many of the advanced programming courses are not even required.

So maybe a better question is this, what are the bare minimum required teachings to prepare a student to become a successful programmer? Are the core courses in a CS program sufficient to teach students the most essential computer programming concepts? And if the core concepts of computer programming could not be covered in a small amount of space, then why does Knuth try to present The Art of Computer Programming as a series of books that can teach someone the core concepts of programming over the scope of a few books?

15. And when I say bare minimum, I mean teachings required to prepare someone to really think like a programmer, which includes courses on data structures and algorithms.

I realize someone could learn programming from a single book, and spend the rest of their life being a professional programmer without ever taking another college programming course. But this would not prepare you to really think about the structure of how algorithms are designed.

So those who take a 20 day course on Visual Basic don't meet the bare minimum requirements I'm referring to.