Jump to ratings and reviews
Rate this book

Python Algorithms: Mastering Basic Algorithms in the Python Language

Rate this book
Python Algorithms explains the Python approach to algorithm analysis and design. Written by Magnus Lie Hetland , author of Beginning Python , this book is sharply focused on classical algorithms, but it also gives a solid understanding of fundamental algorithmic problem-solving techniques.  

352 pages, Paperback

First published October 29, 2010

62 people are currently reading
427 people want to read

About the author

Magnus Lie Hetland

8 books13 followers

Ratings & Reviews

What do you think?
Rate this book

Friends & Following

Create a free account to discover what your friends think of this book!

Community Reviews

5 stars
42 (36%)
4 stars
45 (39%)
3 stars
21 (18%)
2 stars
5 (4%)
1 star
1 (<1%)
Displaying 1 - 6 of 6 reviews
15 reviews5 followers
December 13, 2010
Pros:
- Very clear explanation of a complex subject.
- Each chapter builds upon the previous chapters so that this is more like a class than a reference manual.
- More approachable that the Sedgewick and Cormen.

Cons:
- The almost constant parenthetical phrases distract from the text and quickly become irritating. After page 20 I just skipped them and found that I understood the concepts more quickly.
- The use of single letter variables in the code examples makes it more difficult to understand the structure of a new concept. When there are several of them, it can become confusing. (See page 207.) Why not just use descriptive variable names?

There are sections that make note of how to implement certain algorithms using Python specific features, and this is very helpful, but this is first and foremost a book on algorithmic theory that happens to use Python for code examples.
Profile Image for Yask.
7 reviews20 followers
February 18, 2017
Since this is my final year of college, I had to prepare for technical interviews. Python has always been the language of my choice and I bought this book to read good quality algorithmic program's source code. (which unfortunately, I couldn't find online anywhere).

I didn't read it to learn algorithms or exercise interview problems. I was already familiar with those, and just wanted to go through the source codes to learn some tricks, design pattern .. etc.

For example, for creating graph using adjacency list, I learnt a more pythonic way of structuring it.

from collections import defaultdict

def add_edge(self, from_node, t0_node):
self.adj_list[form_node].append(to_node)



Little things like these go a long way in 30 minute timed stressful interviews.
Profile Image for Michael.
31 reviews
June 9, 2013
Great book. He uses humor and a genuine love of the material to what can be challenging stuff. My only problem was the over-use of singe-char variable names.
230 reviews3 followers
November 5, 2015
It is just a wonderful book on algorithms. I was happy to read it because there is everything necessary about algorithms. The author put a lot of effort to describe everything in a very clear way.
Profile Image for Maxim.
33 reviews1 follower
October 19, 2019
The author didn't write the book for others, he'd written it for himself. He constantly distracts and talks to himself, touching core topics only superficially.

As a result, the book is poorly structured, patchy, incomplete, and even repetitive!

There's a little "meat" in the book, maybe, 100 pages of core content scattered/hidden across a vaguely relevant chatter, distractions, and forward/backward references. I didn't know that one can cram so much unnecessary information in so tiny volume.

Even worse, there's a little code in the book. And when there is, you can bet that it will be:
1. Abstract and didactic
2. Unreadable (single letter variable names, Carl!)
3. More often than not, without call examples (don't you even dream about unit tests)
4. Eventually, unpythonic

All in all, I'm tempted to rate it 2/5. Nevertheless, there is some valuable information, not to mention references and exercises, so the final score is 3/5.
Displaying 1 - 6 of 6 reviews

Can't find what you're looking for?

Get help and learn more about the design.