| |
| |
| |
Abstract Data Types 1 | |
| |
| |
| |
Introduction | |
| |
| |
| |
Abstractions | |
| |
| |
| |
Abstract Data Types | |
| |
| |
| |
Data Structures | |
| |
| |
| |
The Date ADT | |
| |
| |
| |
Preconditions and Postconditions | |
| |
| |
| |
Using the ADT | |
| |
| |
| |
Implementing the ADT | |
| |
| |
| |
The Bag ADT | |
| |
| |
| |
Using the ADT | |
| |
| |
| |
Selecting a Data Structure | |
| |
| |
| |
The Class Definition | |
| |
| |
| |
Iterators | |
| |
| |
| |
The Set ADT | |
| |
| |
| |
Using the ADT | |
| |
| |
| |
Implementing the ADT | |
| |
| |
| |
The Map ADT | |
| |
| |
| |
Defining the ADT | |
| |
| |
| |
Implementing the Map ADT | |
| |
| |
| |
Alternate Implementation | |
| |
| |
| |
Application: Histograms | |
| |
| |
| |
Building a Histogram | |
| |
| |
| |
Implementing the Histogram ADT | |
| |
| |
Programming Problems | |
| |
| |
| |
Arrays and Vectors 43 | |
| |
| |
| |
The Array Structure | |
| |
| |
| |
Simulating an Array | |
| |
| |
| |
The Array ADT | |
| |
| |
| |
Implementing the ADT | |
| |
| |
| |
The Python List (Vector) | |
| |
| |
| |
Multi���Dimensional Arrays | |
| |
| |
| |
The MultiArray ADT | |
| |
| |
| |
Data Organization | |
| |
| |
| |
Variable Length Arguments | |
| |
| |
| |
MultiArray Implementation | |
| |
| |
| |
The Matrix ADT | |
| |
| |
| |
Matrix Operations | |
| |
| |
| |
Implementing the ADT | |
| |
| |
| |
Application: The Game of Life | |
| |
| |
| |
Rules of the Game | |
| |
| |
| |
Designing a Solution | |
| |
| |
| |
ADT Implementation | |
| |
| |
Exercises | |
| |
| |
Programming Problems | |
| |
| |
| |
Algorithm Analysis 81 | |
| |
| |
| |
Complexity Analysis | |
| |
| |
| |
Big���O Notation | |
| |
| |
| |
Classes of Algorithms | |
| |
| |
| |
Empirical Analysis | |
| |
| |
| |
Evaluating ADT Implementations | |
| |
| |
| |
Evaluating the Python List | |
| |
| |
| |
Evaluating the Set ADT | |
| |
| |
| |
Searching | |
| |
| |
| |
Linear Search | |
| |
| |
| |
Binary Search | |
| |
| |
| |
Working with Ordered Lists | |
| |
| |
| |
Building An Ordered List | |
| |
| |
| |
Merging Ordered Lists | |
| |
| |
| |
The Set ADT Revisited | |
| |
| |
| |
Application: The Sparse Matrix | |
| |
| |
| |
Implementation | |
| |
| |
| |
Analysis | |
| |
| |
Exercises | |
| |
| |
Programming Problems | |
| |
| |
| |
The Linked List 123 | |
| |
| |
| |
A Linked Structure | |
| |
| |
| |
The Singly���Linked List | |
| |
| |
| |
Basic Operations | |
| |
| |
| |
Evaluating the Linked List | |
| |
| |
| |
The Bag ADT Revisited | |
| |
| |
| |
Implementation Details | |
| |
| |
| |
Linked List Iterator | |
| |
| |
| |
Using a Tail Pointer | |
| |
| |
| |
The Ordered Linked List | |
| |
| |
| |
The Sparse Matrix Revisited | |
| |
| |
| |
The New Implementation | |
| |
| |
| |
Comparing Implementations | |
| |
| |
| |
Application: Polynomials | |
| |
| |
| |
Polynomial Operations | |
| |
| |
| |
The Polynomial ADT | |
| |
| |
| |
ADT Implementation | |
| |
| |
Exercises | |
| |
| |
Programming Problems | |
| |
| |
| |
Advanced Linked Lists 125 | |
| |
| |
| |
Doubly���Linked List | |
| |
| |
| |
Organization | |
| |
| |
| |
List Operations | |
| |
| |
| |
Circular Linked List | |
| |
| |
| |
Organization | |
| |
| |
| |
List Operations | |
| |
| |
| |
Multi���Linked Lists | |
| |
| |
| |
Multiple Chains | |
| |
| |
| |
The Sparse Matrix | |
| |
| |
| |
Complex Iterators | |
| |
| |
| |
Application: Text Editor | |
| |
| |
| |
Typical Editor Operations | |
| |
| |
| |
The Edit Buffer ADT | |
| |
| |
| |
Implementing the ADT | |
| |
| |
Exercises | |
| |
| |
Programming Problems | |
| |
| |
| |
Stacks 127 | |
| |
| |
| |
The Stack ADT | |
| |
| |
| |
Implementing the Stack | |
| |
| |
| |
Vector Based | |
| |
| |
| |
Linked List Version | |
| |
| |
| |
Stack Applications | |
| |
| |
| |
Balanced Delimiters | |
| |
| |
| |
Evaluating Postfix Expressions | |
| |
| |
| |
Application: Solving a Maze | |
| |
| |
| |
Backtracking | |
| |
| |
| |
Designing a Solution | |
| |
| |
| |
The Maze ADT | |
| |
| |
| |
ADT Implementation | |
| |
| |
Exercises | |
| |
| |
Programming Problems | |
| |
| |
| |
Queues 129 | |
| |
| |
| |
The Queue ADT | |
| |
| |
| |
Implementing the Queue | |
| |
| |
| |
Vector Based | |
| |
| |
| |
Circular Array | |
| |
| |
| |
Linked List Version | |
| |
| |
| |
The Priority Queue | |
| |
| |
| |
Application: Computer Simulations | |
| |
| |
| |
Airline Ticket Counter | |
| |
| |
| |
Class Specifications | |
| |
| |
Exercises | |
| |
| |
Programming Problems | |
| |
| |
| |
Hash Tables 131 | |
| |
| |
| |
Introduction | |
| |
| |
| |
Hash Functions | |
| |
| |
| |
Open Addressing | |
| |
| |
| |
Linear Probing | |
| |
| |
| |
Collision Resolution | |
| |
| |
| |
Bucket Hashing | |
| |
| |
| |
Hashing Efficiency | |
| |
| |
| |
The Map ADT Revisited | |
| |
| |
| |
Application: The Color Histogram | |
| |
| |
Exercises | |
| |
| |
Programming Problems | |
| |
| |
| |
Recursion 133 | |
| |
| |
| |
Recursive Functions | |
| |
| |
| |
Properties of Recursion | |
| |
| |
| |
Classic Example: The Factorial Function | |
| |
| |
| |
Greatest Common Divisor | |
| |
| |
| |
Recursion and Stacks | |
| |
| |
| |
The Towers of Hanoi | |
| |
| |
| |
Backtracking Revisited | |
| |
| |
| |
The Eight���Queens Problem | |
| |
| |
| |
Solving the Four���Queens | |
| |
| |
| |
Recursive Solution | |
| |
| |
| |
Application: Sudoku Puzzles | |
| |
| |
Exercises | |
| |
| |
Programming Problems | |
| |
| |
| |
Binary Trees and Heaps 135 | |
| |
| |
| |
Tree Structure | |
| |
| |
| |
The Binary Tree | |
| |
| |
| |
Traversals | |
| |
| |
| |
Arithmetic Expresssions | |
| |
| |
| |
Tree Threading | |
| |
| |
| |
Heaps | |
| |
| |
| |
Insertions | |
| |
| |
| |
Removals | |
| |
| |
| |
Evaluating the Heap | |
| |
| |
| |
The Priority Queue Revisited | |
| |
| |
| |
Application: Morse Code | |
| |
| |
Exercises | |
| |
| |
Programming Problems | |
| |
| |
| |
Advanced Search Trees 137 | |
| |
| |
| |
The Binary Search Tree | |
| |
| |
| |
Searching | |
| |
| |
| |
Insertions | |
| |
| |
| |
Deletions | |
| |
| |
| |
Evaluating the BST | |
| |
| |
| |
AVL Trees | |
| |
| |
| |
Insertions | |
| |
| |
| |
Deletions | |
| |
| |
| |
Evaluating the AVL Tree | |
| |
| |
| |
2���3 Trees | |
| |
| |
| |
Splay Trees | |
| |
| |
| |
Application: Improved Map ADT | |
| |
| |
Exercises | |
| |
| |
Programming Problems | |
| |
| |
| |
Sorting Algorithms 139 | |
| |
| |
| |
The Simple Algorithms | |
| |
| |
| |
Bubble Sort | |
| |
| |
| |
Selection Sort | |
| |
| |
| |
Insertion Sort | |
| |
| |
| |
Radix Sort | |
| |
| |
| |
Basic Algorithm | |
| |
| |
| |
Bucket Sorting | |
| |
| |
| |
Divide and Conquer | |
| |
| |
| |
Merge Sort | |
| |
| |
| |
Quick Sort | |
| |
| |
| |
Heap Sort | |
| |
| |
| |
Application: Empirical Analysis | |
| |
| |
Exercises | |
| |
| |
Programming Problems | |
| |
| |
| |
Python Review | |
| |
| |
| |
Basic Concepts | |
| |
| |
| |
Functions | |
| |
| |
| |
Sequence Types | |
| |
| |
| |
Classes | |
| |
| |
| |
Copying Objects | |
| |
| |
| |
Exceptions | |
| |
| |
| |
Object���Oriented Programming 143 | |
| |
| |
| |
Introduction | |
| |
| |
| |
Encapsulation | |
| |
| |
| |
Inheritance | |
| |
| |
| |
Polymorphism | |