Classic Computer Science Problems

Essential Techniques for Practicing Programmers

A Book Series by David Kopec

Overview

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.

Contents

The computer science topics touched on through the problems are wide ranging and include:

The Books

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

  • Written against Swift 4.1 (Xcode 9), all examples compile in Swift 4.2 (Xcode 10)
  • Published in April, 2018
  • Available in print from Manning, Amazon, and other fine book sellers.
  • Available in PDF, .mobi (Kindle), and .epub (Apple Books & Other E-readers) from Manning.

The Code

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.

One intrepid reader has even ported the first five chapters of the book to C++. Please let me know if you port the book to another language. I would love to link to that here.

Buzz

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

“David is an excellent programmer and teacher and you should buy his book if you have ANY interest in algorithms period. The great thing about Python is that you’ll understand pretty much everything that’s going on even if you’re a newbie.”
—Dan Loewenherz
Source: Twitter
“One accomplishment that the writer really brings off, and which is nontrivial, is that he is able to use an approachable tone without being patronizing or using distracting attempts at humor. The writing is really clear. This is a good example of superb didactic technical writing.”
—Daniel Kenney-Jung
Source: Official Manning Reviewer

Praise for Classic Computer Science Problems in Swift

“...As a self taught programmer without formal education I got a deeper understanding and refresher on some of the most classic computer science problems while at the same time getting to know Swift. Conclusion: time well spent!”
—Samuel Bosch
Source: Amazon Germany
“This is a very excellent book for people who want to learn about some classic algorithms using the Swift Programming Language. I'm still a Swift beginner but this book helped me to learn how to solve some of the most interesting problems using the language. The chapters I enjoyed most are the Constraint Satisfaction and Genetic Algorithms since these were concepts I always heard about but didn't really understand them. Recommended if you want to boost your algorithmic skills, refresh your mind about concepts you learned in your CS classes and even for coding interviews.”
—Godfred Asamoah
Source: Amazon UK
“An extraordinary Swift language book and a contribution to the practice of Swift algorithmic problem solving.”
—Eric Giannini, Nexmo
Source: Official Manning Reviewer
“A fun read to sharpen your classic programming skills and to bring your Swift programming to another level.”
—Becky Huett, Big Shovel Labs
Source: Official Manning Reviewer
“An excellent book for all Swift programmers, and for students learning algorithms.”
—Julien Pohie, Dell
Source: Official Manning Reviewer
“A hands-on and informative exploration of computer science problems.”
—Chad Johnston, Polaris Alpha
Source: Official Manning Reviewer
“...the first CS book I've read cover to cover... great job @davekopec!”
—André Veiga
Source: Twitter
“Classic Computer Science Problems seems to understand the psychological quirks of software developers and how to use them as a motivational tool.”
—Mitch Chapman
Source: Blog

Interviews with David

Free Content

Classic Computer Science Problems in Python

Classic Computer Science Problems 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:

Contact Me

I always love to hear from readers. Please send me your questions or comments on Twitter or by email.