Pythonistas, rejoice! All the code in this book is written in Python. The original edition of this book, A Common-Sense Guide to Data Structures and Algorithms (the second edition of which was published in 2020), was language-agnostic; it was written using multiple programming languages. The idea behind this was that we didn’t want to imply that the book would only be helpful for one language, given that data structures and algorithms are concepts that apply across all of computing in general.
Over the years, I received feedback from readers who expressed that they would love to see language-specific editions of the book. After all, if you’re working with one particular programming language, wouldn’t it be nice to have a book in which all of the code is in that language?
Accordingly, I set out to create new single-language versions of A Common-Sense Guide to Data Structures and Algorithms. The first of these is the Python version and is what you’re reading now! And because there’s so much to say about data structures and algorithms, this is the first volume in a progression of books. In this volume, I lay the foundation for these concepts and cover the most common data structures and algorithms. In the next volume, I’ll build upon this knowledge to level up further with more advanced ideas and techniques.