Based on the authors market leading data structures books in Java and C++, thisbook offers a comprehensive, definitive introduction to data structures in Python by authoritative authors. Data Structures and Algorithms in Python is the first authoritative object-oriented book available for Python data structures. Designed to provide a comprehensive introduction to data structures and algorithms, including their design, analysis, and implementation, the text will maintain the same general structure as Data Structures and Algorithms in Java and Data Structures and Algorithms in C++.Begins by discussing Pythons conceptually simple syntax, which allows for a greater focus on concepts. Employs a consistent object-oriented viewpoint throughout the text. Presents each data structure using ADTs and their respective implementations and introduces important design patterns as a means to organize those implementations into classes, methods, and objects. Provides a thorough discussion on the analysis and design of fundamental data structures. Includes many helpful Python code examples, with source code provided on the website. Uses illustrations to present data structures and algorithms, as well as their analysis, in a clear, visual manner. Provides hundreds of exercises that promote creativity, help readers learn how to think like programmers, and reinforce important concepts. Contains many Python-code and pseudo-code fragments, and hundreds of exercises, which are divided into roughly 40% reinforcement exercises, 40% creativity exercises, and 20% programming projects.
Designed for use in introductory- or intermediate-level courses in data structures and algorithms, this book has modest prerequisites: familiarity with high school mathematics and an acquaintance with some procedural or object-oriented programming language, by which the authors mean having an understanding of variables, expressions, for and while loops, and functions or methods. Prior experience with Python is not required, as chapter 1 amounts to a primer on the basics of the language.
The material includes the concepts one would expect: stacks, queues, linked lists, trees, maps, hash tables, sorting, and graph algorithms. But there are also chapters on object-oriented programming, algorithmic analysis, recursion, search trees, graph algorithms, and B-trees. For good measure, examples are given for applications such as processing file systems, matching Hypertext Markup Language (HTML) tags, elementary cryptography, text frequency analysis, automated geometric layout, Huffman encoding, DNA sequence alignment, and search engine indexing. Clearly, to cover all this material in one semester, the instructor will need to either proceed at a rapid clip or designate sections to be covered in class and sections for outside reading.
What sets this book apart is the approach taken by the authors: the presentation is centered on the specification of abstract data structures. From these, Python code is developed in strict object-oriented fashion, with data structures encapsulated in classes and algorithms expressed as class methods. When appropriate, different implementation strategies are detailed, such as arrays or linked lists for stacks and queues. Nearly all of the algorithms are presented as Python code fragments, which the reader must encapsulate in appropriate code to make an executable program.
The chapter on algorithmic analysis deserves special mention. The topic is growth rates, and the authors present seven functions for the analysis: constant, logarithmic, linear, n -log- n , quadratic, polynomial, and exponential. For asymptotic analysis, the authors introduce big O, big omega, and big theta notations, with exceptionally clear explanations and examples. In subsequent chapters, the efficiency of the algorithms under study is given, but not analyzed, using the big O notation.
The book provides plenty of exercises at the end of each chapter. These fall into one of three categories: reinforcement, creativity, or projects. In many places, the authors use creativity exercises to present significant material, without any hints on how to proceed. In reality, most students will solve these problems by searching the Internet for existing solutions, perhaps translating found solutions into Python. Nevertheless, the quantity and quality of exercises is very good; students should be encouraged to work on as many as they can, and to read the rest and at least mentally plan an approach.
The publisher's website contains all of the Python code shown in the book, plus solutions to many (but not all) of the exercises, color versions of the black-and-white photos and illustrations in the book, and slides in PowerPoint and portable document format (PDF). Some of this material, intended for instructors, requires registration. A summary of errata is not provided.
This textbook reflects the in-class experience of two of the three authors, who authored two previous books in the series [1,2]. However, this book does not simply translate either of the previous books into Python. The material, and especially the code, has been significantly redesigned and reorganized. Plus, the authors acknowledge the copious comments they have received from reviewers and readers.
In a very real sense, this is a mature book that deserves consideration from instructors who wish to teach Python at this level. But I'm left with the feeling that Python may be more the language of current fashion than the optimal language for studying algorithms and data structures. I don't object to Python per se, but while reading this book, I sometimes had the feeling that the Python code was developed nearly ex nihilo, dictated more by language considerations than by a logical progression of incremental development from abstract data structure to executable code. In that respect, of course, Python is not unique.
In summary, I found this to be a solid book, worthy of joining the pool of textbooks on data structures and algorithms.
Online Computing Reviews Service
Access critical reviews of Computing literature here