A Common-Sense Guide to Data Structures and Algorithms in Python, Volume 1 (PragProg)

Big O Notation can make your code faster by orders of magnitude. Get the hands-on info you need to master data structures and algorithms for your daily work.

jwpython-500

Jay Wengrow @jaywengrow

edited by Katharine Dvorak @katied

If you thought data structures and algorithms were all just theory, you’re missing out on what they can do for your Python code. Learn to use Big O notation to make your code run faster by orders of magnitude. Choose from data structures such as hash tables, trees, and graphs to increase your code’s efficiency exponentially. With simple language and clear diagrams, this book makes this complex topic accessible, no matter your background. Every chapter features practice exercises to give you the hands-on information you need to master data structures and algorithms for your day-to-day work.

This new edition uses Python exclusively as its language for all code implementations, in both the main text as well as the exercises and solutions. Python has its own unique set of capabilities and constraints, so all the algorithms have been optimized for use in Python. Additionally, all Python code now follows the PEP 8 style guide and runs equivalently in both Python versions 2 and 3.

Algorithms and data structures are much more than abstract concepts. Mastering them enables you to write code that runs faster and more efficiently, which is particularly important for today’s web and mobile apps. Take a practical approach to data structures and algorithms, with techniques and real-world scenarios that you can use in your daily production code. The Python edition uses Python exclusively for all code examples, exercise, and solutions.

Use Big O notation to measure and articulate the efficiency of your code, and modify your algorithm to make it faster. Find out how your choice of arrays, linked lists, and hash tables can dramatically affect the code you write. Use recursion to solve tricky problems and create algorithms that run exponentially faster than the alternatives. Dig into advanced data structures such as binary trees and graphs to help scale specialized applications such as social networks and mapping software. You’ll even encounter a single keyword that can give your code a turbo boost. Practice your new skills with exercises in every chapter, along with detailed solutions.

Use these techniques today to make your Python code faster and more scalable.


Jay Wengrowis an experienced educator and software engineer. He is the founder of Actualize, an award-winning US coding bootcamp that has helped hundreds of people from all backgrounds launch their careers as software engineers. He is passionate about making software development more accessible by breaking the complex down into its simpler, easier parts.


Don’t forget you can get 35% off with your Devtalk discount! Just use the coupon code “devtalk.com" at checkout :+1:

6 Likes

Multi volume? Interesting! I wonder what volume 2 would include :thinking:

1 Like

Why keep compatibility with Python 2 when the language is EOL ? Wouldn’t better to use modern idiomatic Python 3 code ?

The content of the first volume is similar with the 2nd edition of the book (which I own). What would volume 2 be about ?

2 Likes

I agree. I hope the author would just use Python 3.

2 Likes

Hello! Author here - thanks for your interest in the book!

Very good point regarding Python 3 - I think I need to reword the sentence about Python 2 versus 3. The main point was actually to indicate that the book is now compatible with Python 3. However, it just so happens to also still be compatible with Python 2, since the code is simple enough that it didn’t need to rely on idioms unique to Python 3. I hope that makes sense. But we’ll try to reword based on your suggestion.

With regard to Volume 2 - it’s an exciting new project I’m working on now, and hope to have out next year some time. It continues from where Volume 1 leaves off, and introduces the reader to additional concepts of DSA that build upon the knowledge of Volume 1. Topics include (but are not limited to - and also subject to change):

  • Mergesort
  • Benchmarking
  • Randomization Algorithms
  • Caching (plus LRU Cache)
  • Red-Black Trees
  • Treaps
  • Approximation Algorithms
  • Bloom Filters
  • Dealing with NP-Complete problems
  • B-Trees
  • Minimum Spanning Trees
  • Topological Sort
  • Bipartite Matching
  • Parallel Algorithms

I hope that helps!
-Jay

4 Likes

Thanks for your interest in the book!

With regard to Volume 2 - it’s an exciting new project I’m working on now, and hope to have out next year some time. It continues from where Volume 1 leaves off, and introduces the reader to additional concepts of DSA that build upon the knowledge of Volume 1. Topics include (but are not limited to - and also subject to change):

  • Mergesort
  • Benchmarking
  • Randomization Algorithms
  • Caching (plus LRU Cache)
  • Red-Black Trees
  • Treaps
  • Approximation Algorithms
  • Bloom Filters
  • Dealing with NP-Complete problems
  • B-Trees
  • Minimum Spanning Trees
  • Topological Sort
  • Bipartite Matching
  • Parallel Algorithms

I hope that helps!
-Jay

1 Like

Wow that is quite a plan. I am buying both the volumes and will be suggesting folks too. There are so few algorithm books dedicated to Python that doesn’t sound too text bookish. And something that potentially covers slightly advanced ones is definitely worth being on my bookshelf :slight_smile:

2 Likes

From the pragprog site, I read this from the book’s Preface:

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!

What other single-language versions of this books two volumes are planned?

1 Like

Hi! The plan is to put out editions in JavaScript and Java.

2 Likes

Awesome. Excited for both volumes of the book. :slight_smile:

1 Like

Can’t wait for Volume 2 :slight_smile:

1 Like

I’m currently half way through Volume 1 so will definitely be grabbing Volume 2 when it’s released!

1 Like