Computing Reviews
Today's Issue Hot Topics Search Browse Recommended My Account Log In
Review Help
Search
Data structures and algorithms with Python
Lee K., Hubbard S., Springer Publishing Company, Incorporated, New York, NY, 2015. 363 pp. Type: Book (978-3-319130-71-2)
Date Reviewed: May 28 2015

A search for “data structures and algorithms” on Amazon claims to find more than 14,000 hits. Some of these are not directly related to the topic (the first page I get has several books on interviewing for programming positions), but it is probably fair to estimate that there are thousands of books on the topic. Adding Python to the search narrows it to about 60 titles, still far too many for any reasonable instructor to consider for use as a textbook.

One problem with books in this topic is that they tend to be of two sorts: either general books that focus on the mathematics and analysis of algorithm runtime behavior, or mostly dumps of algorithm code in whatever target language with some brief notes on behavior. This stems, in part, from the overloading of the computer science curriculum. Curricula often now include a shotgun list of popular topics, which leaves less time for some of the basics. This stems, in part, from the pervasive belief that mathematics is hard (“Let’s go coding”) and in part from the tendency of computing programs to teach one programming language as primary with the concomitant need to have an algorithms book for every such language. These tendencies are regrettable but unavoidable, and as a practical matter, for many working programmers the actual algorithms behind their code may be hidden and sometimes rather difficult to discern. (How is the sort in your favorite language actually implemented?)

This text is on the practical side with little mathematics and only minimal actual analysis of the algorithms.

There are 12 chapters with primary coverage of a bit of computational complexity, recursion, sequences, sets and maps, trees (several chapters), graphs, heaps, and heuristic searching. The algorithms covered are a good sampling of algorithms used in practice.

Program code is available from the author’s website (though it isn’t necessarily easy to find it as there does not seem to be a direct link actually in the text; a link to the author’s website is included, but the front page has no link to the book materials), and some programs are included in whole in the text, including a 26-page appendix. Those pages might better have been spent on a good index.

Some of the programs use turtle graphics (and an appendix is provided for the basics of this). Generally, algorithms that come with some kind of graphical output will be more interesting to students, so this is a good thing. Programs with graphical intermediate results (sorting is probably one of the best examples) also provide debugging assistance and help in understanding.

The book is reasonably sized for a semester-long algorithms course for students who know Python. Python 3 is assumed, but those familiar with Python 2.x should have few problems.

There are a few things that stand out to me as problems, though they might not be showstoppers. On one page, the text asks what kind of sorting algorithm Python uses, and what is its computational complexity, as a lead in to talking about sort algorithms. But the question of what Python actually uses is never answered, probably because Python’s built-in sort (Timsort) is a complicated hybrid sort. Better not to have raised quite that question.

In another section, memoization is discussed, with the probably inevitable Fibonacci function. But it is not mentioned that for memoization to be useful, the function must always return the same result for the same inputs.

With sorting examples, it can be very useful for students to run different sorts with the same input varying in size and plot the results along with the function n*log(n). This is easily done in Python and can be a very useful aid for students to understand algorithmic complexity in practice. This is suggested in an exercise (but with XML output (!?): why not use matplotlib, which is available in Python 3?), but it would be better done in the text with examples and sample output.

In sum, this isn’t a bad book on the topic, but it isn’t quite a good one either.

Reviewer:  Jeffrey Putnam Review #: CR143479 (1508-0663)
Bookmark and Share
  Reviewer Selected
Featured Reviewer
 
 
Data Structures (E.1 )
 
 
Python (D.3.2 ... )
 
Would you recommend this review?
yes
no
Other reviews under "Data Structures": Date
Handbook of algorithms and data structures
Gonnet G. (ed), Baeza-Yates R., Addison-Wesley Longman Publishing Co., Inc., Boston, MA, 1991. Type: Book (9780201416077)
Feb 1 1992
Data structures and algorithm analysis
Weiss M., Benjamin-Cummings Publ. Co., Inc., Redwood City, CA, 1992. Type: Book (9780805390544)
Aug 1 1992
Data structures and program design in C
Kruse R., Leung B., Tondo C., Prentice-Hall, Inc., Upper Saddle River, NJ, 1992. Type: Book (9780137256495)
Oct 1 1992
more...

E-Mail This Printer-Friendly
Send Your Comments
Contact Us
Reproduction in whole or in part without permission is prohibited.   Copyright 1999-2024 ThinkLoud®
Terms of Use
| Privacy Policy