Python Algorithms: Mastering Basic Algorithms in the Python Language 2nd ed. Edition
| Magnus Lie Hetland (Author) Find all the books, read about the author, and more. See search results for this author |
Use the Amazon App to scan ISBNs and compare prices.
Python Algorithms, Second Edition 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.
The book deals with some of the most important and challenging areas of programming and computer science in a highly readable manner. It covers both algorithmic theory and programming practice, demonstrating how theory is reflected in real Python programs. Well-known algorithms and data structures that are built into the Python language are explained, and the user is shown how to implement and evaluate others.
Customers who viewed this item also viewed
Editorial Reviews
Review
“The book is structured as probably any book or course for programming. Starting from the basics with the Asymptotic Notation and the complexity of algorithms and going to various structures and cases. After each chapter you have problems with hints for their resolution at the end of the book. … If you know Python already to some good working level and you need to understand algorithms for a reason, the book would bring you there.” (Vitosh Academy, vitoshacademy.com, October, 2015)
About the Author
Product details
- Publisher : Apress; 2nd ed. edition (September 4, 2014)
- Language : English
- Paperback : 336 pages
- ISBN-10 : 148420056X
- ISBN-13 : 978-1484200568
- Item Weight : 13.2 pounds
- Dimensions : 7.01 x 0.73 x 10 inches
- Best Sellers Rank: #1,076,170 in Books (See Top 100 in Books)
- #468 in Mathematical & Statistical Software
- #969 in Software Design & Engineering
- #1,248 in Python Programming
- Customer Reviews:
About the author

Discover more of the author’s books, see similar authors, read author blogs and more
Customer reviews
Customer Reviews, including Product Star Ratings help customers to learn more about the product and decide whether it is the right product for them.
To calculate the overall star rating and percentage breakdown by star, we don’t use a simple average. Instead, our system considers things like how recent a review is and if the reviewer bought the item on Amazon. It also analyzed reviews to verify trustworthiness.
Learn more how customers reviews work on AmazonTop reviews from the United States
There was a problem filtering reviews right now. Please try again later.
Before starting the review, let me clarify where I stay in the position of Algorithms - I have been a student at an algorithm course in HackBulgaria with Python and I have read some chapters from Algorithm Design (Kleinberg & Trados) and The Algorithm Design (from Skiena). Furthermore, sometimes I take part in algorithmic competitions, but I am not amongst the top coders.
Having said all of this, let me start with the review:
Structure> The book is structured as probably any book or course for programming. Starting from the basics with the Asymptotic Notation and the complexity of algorithms and going to various structures and cases. After each chapter you have problems with hints for their resolution at the end of the book. Three appendices - way to speed up python, list of all algorithmic problems and graph terminology. I found them useful.
Positive points> As the book of Kleinberg and Trados, here the author really tries to tell a story about the algorithm and he manages it pretty well. Probably by experience he has realized that it is quite easy to "lose" the reader on the tough parts, thus there are some pictures and jokes. Definitely something that I liked.
Negative points (a.k.a. hate)> The only hate part I can think about is that the exercises are not completely resolved, but only hints are given for them. Anyway, for an average programmer having access to google and stackoverflow, it should not be difficult to solve those with the hints. But still, I prefer to know the authors ideas of how to solve those. The more code you see, the better you write your own.
Code Present> Yes. Totally. And that is great! :) Something good about the code - whenever the code allows it, the author provides in a comment an example of what should be written in the shell to run the code. That is a good practise more authors should follow, so the readers are never confused. That is an example of the commented code:
"""
>>> G = some_graph()
>>> list(iddfs(G, 0))
[0, 1, 2, 3, 4, 5, 6, 7]
"""
Style of writing> A nice one. As readable as I could imagine. With jokes, trying to attract the attention to the subject. Telling the stories behind some of the famous algorithms is also part of the book - e.g. the thing with the Swedish towns and villages, the bridges of Kaliningrad. Even when there is no such story, the author creates one, which I liked.
The Verdict> If you know Python already to some good working level and you need to understand algorithms for a reason, the book would bring you there. If you do not know Python, learn it first and then go into this book. :)
Top reviews from other countries
It is more a complement than a all in one thing.
The explanations are a bit here and there. Not easy to understand.
Maybe have other good books more complete than this one.










