Classic Computer Science Problems is a series of books that helps software developers learn several problem solving techniques from the realm of computer science. The books are written in a tutorial-like, code-centric format. They are appropriate for experienced software developers who want to refresh their skillset, and intermediate programmers who are looking to take their skills to the next level. They can also be helpful when learning some of the more advanced aspects of the programming languages covered by the series.
The two books in the series so far are Classic Computer Science Problems in Python and Classic Computer Science Problems in Swift. Both are published by Manning. Reading each book does not require a CS degree. In fact, self-taught programmers will get a useful survey of computer science topics they missed by not having a CS education. The books are broad, not deep. Each topic is covered by going over some classic problems, typically taught in a CS undergraduate curriculum, and their solutions in the book's respective language.
These are not textbooks. They are not heavy on mathematical notation, nor do they claim to be replacements for a class in data structures and algorithms. Instead, they aim to excite developers and students about engaging computer science topics by presenting them succinctly with working code in the language of the reader's choice.
The computer science topics touched on through the problems are wide ranging and include:
- Essential Techniques
- Bit Manipulation
- Dynamic Programming
- Permutation Generation
- Search Algorithms
- Binary Search
- Breadth-First Search
- Depth-First Search
- Constraint Satisfaction Problems
- Solving Graph Problems
- Representing Graphs using Hybrid Adjacency Lists
- Search in Graphs
- Finding shortest paths with Dijkstra's Algorithm
- Finding the minimum-spanning tree with Jarnik's Algorithm (Prim's Algorithm)
- Genetic Algorithms
- K-means Clustering
- Neural Networks
- Adversarial Search
- Alpha beta pruning (Python book only)
Classic Computer Science Problems in Python
- Requires Python 3.7+
- Every code example uses type hints
- Early access eBook with all chapters available now from Manning
- Print edition arriving in early 2019
Classic Computer Science Problems in Swift
The source code from both books is freely available under the terms of the Apache License. This effectively means you can reuse the code in any project you work on, whether personal or commercial, as long as you credit me/the book in an acknowledgement. You can find repositories on GitHub containing the source code for the Python book and the Swift book.
Both books in the series have been fortunate to receive great reviews from official reviewers and readers alike.
Praise for Classic Computer Science Problems in Python
Praise for Classic Computer Science Problems in Swift
Interviews with David
The Learn Swift Podcast
Inside iOS Dev
Classic Computer Science Problems in Python
Classic Computer Science Problems in Swift
- Chapter 2: Search Problems (PDF)
- Chapter 4: Graph Problems (PDF)
- Article: Solving Mazes with Swift
- Slideshare: A* Search in Swift: navigating a maze
- Article: Tic-Tac-Toe (in Swift)
Open Source Projects Related to the Books
The Swift book was based on several (fairly small) open source projects that I had worked on prior to writing it.
Questions (and Answers)
Are these books suitable for beginning programmers?
Not really: The books in the series assume at least intermediate knowledge of the programming language they are written against. For example, you should be at least an intermediate Python programmer before picking up Classic Computer Science Problems in Python. You do not need to have taken a data structures and algorithms class, though. No data structures and algorithms knowledge is assumed, but programming knowledge is.
Are the books a good way to learn the programming languages that they cover?
Generally, no, but for some readers, yes. I have heard some readers have used them that way, but I think this will only work for programmers who are very experienced in another language prior to picking up the book. There is no "beginners" content about how to use each of the languages in the books. That said, if you are already an intermediate programmer in the given language, reading the book will help you learn some of the language's more advanced constructs. For example, if you have some basic knowledge of Swift and a strong programming background, you will better understand protocol-oriented programming and Swift enums after reading Classic Computer Science Problems in Swift.
Why isn't sorting or some other classic data structures and algorithms topic covered in the series?
These books are not data structures and algorithms textbooks. They don't claim to be that, and they are geared for a slightly different audience. These are broad survey books that cover a large variety of computer science topics in a succinct, friendly, tutorial-like fashion, heavy with a lot of real code. In other words, they are not meant to be academically rigorous, but instead fun while still being educational. Frankly, some of the cliche topics, like sorting, are left out because they will bore many of the self-taught programmers who will pickup the books. The breadth of topics covered in the series actually stretches beyond the gamut of most data structures and algorithms textbooks by covering several topics from artificial intelligence. About half of each book's content can be considered AI. On the other hand, yes, several traditional data structures and algorithms topics are left out.
Will a book in the series in another programming language come out?
It is likely there will be further books in the series. I have already broached the subject with the publisher, and they responded positively about exploring coming out with the book in another programming language. I chose to do the first two books myself in languages that I have significant past experience in. It is possible that I will work with a co-author on a "port" of the book to a language that I am less familiar with. It is not decided what the next programming language in the series will be, but Go is one option we are strongly considering. Other candidates that we have dicussed are Java and Rust. A Kotlin book is not out of the question either.
Will a book in the series be translated into another human language?
Yes, a Chinese publisher has acquired the rights to translate Classic Computer Scinece Problems in Swift into Mandarin. If you are interested in acquring the rights to translate one of the books into another language, please contact me and I will put you in touch with the appropriate person at the publisher.
How much do the books cost?
The MSRP of the print editions is $39.99. However, you can often find it cheaper than that from third-party booksellers. The eBooks are $31.99 from Manning. If you buy the print book, Manning lets you also download the eBook for free. However, as a bonus for reading this far, here is a promo code: ccspkopec should get you 40% off on Manning.com for either book (links to both on Manning's website above). Please let me know if the promo code does not work for you.
I know of a classic problem you didn't include in the book.
Please let me know about it if you think it's just esoteric enough that I haven't heard of it, but it's still fairly classic.
What references did you use when writing the book?
As you can see from footnotes and the More Resources appendix, the two books I relied most heavily upon as references are Algorithms by Sedgewick and Wayne and Artificial Intelligence: A Modern Approach by Russell and Norvig. I also relied on Introduction to Algorithms by Cormen, Leiserson, Rivest, and Stein, The Algorithm Design Manual by Skiena, and Artificial Intelligence in the 21st Century by my late father, Danny Kopec, and Lucci, as further references. I was fortunate to see most of the classic computer science problems in the books during my education at Dartmouth, so I must extend a thank you to the faculty there, especially Tom Cormen and Devin Balkcom. Since, once again (see the earlier question on why certain data structure and algorithms topics are not in the series), these books are not textbooks, if you want a more academically rigorous introduction to the topics covered, I recommend the above mentioned textbooks.
What is the background of the author?
I am an assistant professor of Computer Science and Innovation at Champlain College. I have worked professionally as a software developer and I am an active contributor to open source projects. I am also the author of Dart for Absolute Beginners (Apress, 2014) but I no longer recommend that book since it is now significantly out-of-date. I hold a bachelor's degree in economics from Dartmouth College and a master's degree in computer science, also from Dartmouth. I minored in English during undergrad and I think it helped me write these books :-). I live in Burlington, Vermont (in the United States) with my wife, Rebecca, and my dog, Hallie. Here's Hallie studying algorithms while I wrote the first book in the series: