Table of Contents

1.1 Python overview
1.2 Objects in Python
1.3 Operators and expressions
1.4 Collection types
1.5 Control flow
1.6 Functions
1.7 Simple input and output
1.8 Exception handling
1.9 Iterators and generators
1.10 Additional Python conveniences
1.11 Scopes and namespaces
1.12 Modules and the import statement
1.13 Exercises
1.14 Chapter notes

2.1 Goals, principles, and patterns
2.2 Software development
2.3 Class definitions
2.4 Inheritance
2.5 Namespaces and object-orientation
2.6 Shallow and deep copying
2.7 Exercises
2.8 Chapter notes

3.1 Experimental studies
3.2 The seven functions used in this book
3.3 Asymptotic analysis
3.4 Simple justification techniques
3.5 Exercises
3.6 Chapter notes

4.1 Illustrative examples of recursion
4.2 Analyzing recursive algorithms
4.3 Designing recursive algorithms
4.4 Recursion run amok
4.5 Eliminating tail recursion
4.6 Exercises
4.7 Chapter notes

5.1 Python’s sequence types
5.2 Low-level arrays
5.3 Dynamic arrays and amortization
5.4 Efficiency of Python’s sequence types
5.5 Case study: A Scoreboard class
5.6 Case study: Insertion-sort
5.7 Case study: Simple cryptography
5.8 Multidimensional data
5.9 Exercises
5.10 Chapter notes

6.1 Stacks
6.2 Queues
6.3 Double-ended queues
6.4 Exercises
6.5 Chapter notes

7.1 Singly linked lists
7.2 Circularly linked lists
7.3 Doubly linked lists
7.4 The positional list ADT
7.5 Sorting a positional list
7.6 Case study: Maintaining access frequencies
7.7 Link-based vs. array-based sequences
7.8 Exercises
7.9 Chapter notes

8.1 General trees
8.2 Binary trees
8.3 Linked tree representations
8.4 Array-based tree representations
8.5 Tree traversal algorithms
8.6 Applications of tree traversals
8.7 Case study: An expression tree
8.8 Euler tours
8.9 Exercises
8.10 Chapter notes

9.1 The priority queue abstract data type
9.2 Implementing a priority queue
9.3 Heaps
9.4 Bottom-up heap construction
9.5 Sorting with a priority queue
9.6 Adaptable priority queues
9.7 Exercises
9.8 Chapter notes

10.1 Maps and dictionaries
10.2 Hash tables
10.3 Sorted maps
10.4 Skip lists
10.5 Sets, multisets, and multimaps
10.6 Exercises
10.7 Chapter notes

11.1 Binary search trees
11.2 Balanced search trees
11.3 AVL trees
11.4 Splay trees
11.5 (2,4) trees
11.6 Red-black trees
11.7 Exercises
11.8 Chapter notes

12.1 Sorting algorithms
12.2 Merge-sort
12.3 Quick-sort
12.4 Studying sorting through an algorithmic lens
12.5 Comparing sorting algorithms
12.6 Python’s built-in sorting functions
12.7 Selection
12.8 Exercises
12.9 Chapter notes

13.1 Abundance of digitized text
13.2 Pattern-matching algorithms
13.3 Tries
13.4 Text compression and the greedy method
13.5 Dynamic programming
13.6 Exercises
13.7 Chapter notes

14.1 Graphs
14.2 Data structures for graphs
14.3 Python implementation
14.4 Graph traversals
14.5 Transitive closure
14.6 Directed acyclic graphs
14.7 Shortest paths
14.8 Minimum spanning trees
14.9 Disjoint partitions and union-find structures
14.10 Exercises
14.11 Chapter notes

15.1 Memory management
15.2 Memory hierarchies and caching
15.3 External searching and B-trees
15.4 External-memory sorting
15.5 Exercises
15.6 Chapter notes

16.1 Character strings in Python
16.2 Useful mathematical facts

17.1 Bibliography

The zyBooks version of the Data Structures & Algorithms in Python textbook provides a powerful interactive learning environment

Data Structures & Algorithms in Python zyVersion contains the complete content of the authors’ object-oriented Python data structures book, which is based on their market-leading data structure books in Java and C++.

  • Offers a comprehensive introduction to data structures and algorithms, including their design, analysis, and implementation
  • Includes over 50 interactive animations that enhance learning with step-by-step dynamic illustrations of algorithms, data structure operations and other key concepts
  • Includes over 150 question sets embedded throughout the book that provide immediate feedback to learners, plus over 750 end-of-chapter exercises
  • Extensive Python source code is consistent with standard Python APIs; entire codebase available online

Co-author Professor Michael Goldwasser demonstrates the power of an interactive approach to data structures:

What is a zyVersion?

zyVersions are leading print titles converted and adapted to zyBooks’ interactive learning platform, allowing for a quick and easy transition to an engaging digital experience for instructors and students.

zyBooks’ web-native content helps students visualize concepts to learn faster and more effectively than with a traditional textbook. (Check out our research.)

This zyVersion of Data Structures & Algorithms in Python benefits both students and instructors:

  • Instructor benefits
  • Customize your course by reorganizing existing content or adding your own
  • Continuous publication model updates your course with the latest content and technologies
  • Robust reporting gives you insight into students’ progress, reading and participation
  • Animations and other interactive content can be shown in presentation mode and used during a lecture
  • Student benefits
  • Learning questions and other content serve as an interactive form of reading
  • Instant feedback on homework
  • Concepts come to life through extensive animations embedded into the interactive content
  • Save chapters as PDFs to reference the material at any time

Example of an animated Parson’s Proof from this zyVersion

Authors

Michael Goodrich, PhD 

Distinguished Professor of Computer Science / University of California, Irvine 

Roberto Tamassia, PhD 

Professor of Computer Science / Brown University

Michael Goldwasser, PhD  

Professor of Computer Science / Saint Louis University

Instructors: Interested in evaluating this zyBook for your class?

Check out these related zyBooks