© 2014

Python Algorithms

Mastering Basic Algorithms in the Python Language

  • Authors

Table of contents

  1. Front Matter
    Pages i-xxi
  2. Magnus Lie Hetland
    Pages 1-7
  3. Magnus Lie Hetland
    Pages 9-41
  4. Magnus Lie Hetland
    Pages 43-66
  5. Magnus Lie Hetland
    Pages 67-92
  6. Magnus Lie Hetland
    Pages 93-113
  7. Magnus Lie Hetland
    Pages 115-138
  8. Magnus Lie Hetland
    Pages 139-161
  9. Magnus Lie Hetland
    Pages 163-185
  10. Magnus Lie Hetland
    Pages 187-208
  11. Magnus Lie Hetland
    Pages 209-225
  12. Magnus Lie Hetland
    Pages 227-253
  13. Magnus Lie Hetland
    Pages 255-258
  14. Magnus Lie Hetland
    Pages 259-265
  15. Magnus Lie Hetland
    Pages 267-271
  16. Magnus Lie Hetland
    Pages 273-287
  17. Back Matter
    Pages 289-295

About this book


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.

About the authors

Magnus Lie Hetland is an experienced Python programmer, having used the language since the late 1990s. He is also an associate professor of algorithms at the Norwegian University of Science and Technology, having taught algorithms for the better part of a decade. Hetland is the author of Practical Python and Beginning Python, first and second editions, as well as several scientific papers.

Bibliographic information


“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,, October, 2015)