Practical Algorithms and Data Structures

This book is a practical—and, we hope, entertaining—introduction to some of the most important algorithms and data structures in computer science.

We know that some software engineers think “practical algorithms” is an oxymoron 😞 so we’ve done our best to keep this book brief, useful and approachable.1 The code samples are in idiomatic Python, and the explanations assume that you’re a software engineer, not a prospective computer science researcher.

We’ve also spent more time than usual on some particularly interesting topics like graph traversal and dynamic programming, and less on traditional favorites like sorting algorithms. That’s because we've found ourselves writing graph traversal algorithms all the time in our own software, but basically never implement quicksort. We still love the algorithms that we’ve excluded; as much as possible we link out to other resources for those whose curiosity tempts them beyond the “practical” scope of this book.

Finally, we’d like to mention that this book started as a fork of Problem Solving with Algorithms and Data Structures Using Python, generously Creative Commons licensed by its authors Brad Miller and David Ranum. We chose to adapt their book based on our experience teaching algorithms to practicing software engineers at Bradfield. Our version is also open source and Creative Commons licensed, and we invite pull requests.


[1]Our best explanation for such skepticism is that those engineers never encountered these topics in a way that encouraged deep understanding. Perhaps they were unfortunate enough to participate in a computer science program that encouraged rote memorization, or subjected themselves to such an experience for the sake of succeeding at technical interviews. Or perhaps they became adequate programmers without having encountered the content at all and presume that they’ve reached the limits of their capabilities.

Practical Algorithms and Data Structures

Introduction