Log In
Or create an account ->
Imperial Library
Home
About
News
Upload
Forum
Help
Login/SignUp
Index
Preface to the Second Edition
Changes to the Second Edition
Audience
Conventions Used in This Book
Using Code Examples
Safari® Books Online
How to Contact Us
Acknowledgments
1. Thinking in Algorithms
Understand the Problem
Naïve Solution
Intelligent Approaches
Greedy
Divide and Conquer
Parallel
Approximation
Generalization
Summary
References
2. The Mathematics of Algorithms
Size of a Problem Instance
Rate of Growth of Functions
Analysis in the Best, Average, and Worst Cases
Worst Case
Average Case
Best Case
Lower and Upper Bounds
Performance Families
Constant Behavior
Log n Behavior
Sublinear O(nd) Behavior for d < 1
Linear Performance
Linearithmic Performance
Quadratic Performance
Less Obvious Performance Computations
Exponential Performance
Summary of Asymptotic Growth
Benchmark Operations
References
3. Algorithm Building Blocks
Algorithm Template Format
Name
Input/Output
Context
Solution
Analysis
Variations
Pseudocode Template Format
Empirical Evaluation Format
Floating-Point Computation
Performance
Rounding Error
Comparing Floating-Point Values
Special Quantities
Example Algorithm
Name and Synopsis
Input/Output
Context
Solution
Analysis
Common Approaches
Greedy
Divide and Conquer
Dynamic Programming
References
4. Sorting Algorithms
Terminology
Representation
Comparable Elements
Stable Sorting
Criteria for Choosing a Sorting Algorithm
Transposition Sorting
Insertion Sort
Context
Solution
Analysis
Selection Sort
Heap Sort
Context
Solution
Analysis
Variations
Partition-Based Sorting
Context
Solution
Analysis
Variations
Sorting without Comparisons
Bucket Sort
Solution
Analysis
Variations
Sorting with Extra Storage
Merge Sort
Input/Output
Solution
Analysis
Variations
String Benchmark Results
Analysis Techniques
References
5. Searching
Sequential Search
Input/Output
Context
Solution
Analysis
Binary Search
Input/Output
Context
Solution
Analysis
Variations
Hash-Based Search
Input/Output
Context
Solution
Analysis
Variations
Bloom Filter
Input/Output
Context
Solution
Analysis
Binary Search Tree
Input/Output
Context
Solution
Analysis
Variations
References
6. Graph Algorithms
Graphs
Data Structure Design
Depth-First Search
Input/Output
Context
Solution
Analysis
Variations
Breadth-First Search
Input/Output
Context
Solution
Analysis
Single-Source Shortest Path
Input/Output
Solution
Analysis
Dijkstra’s Algorithm for Dense Graphs
Variations
Comparing Single-Source Shortest-Path Options
Benchmark Data
Dense Graphs
Sparse graphs
All-Pairs Shortest Path
Input/Output
Solution
Analysis
Minimum Spanning Tree Algorithms
Input/Output
Solution
Analysis
Variations
Final Thoughts on Graphs
Storage Issues
Graph Analysis
References
7. Path Finding in AI
Game Trees
Static Evaluation Functions
Path-Finding Concepts
Representing State
Calculating Available Moves
Maximum Expansion Depth
Minimax
Input/Output
Context
Solution
Analysis
NegMax
Solution
Analysis
AlphaBeta
Solution
Analysis
Search Trees
Path-Length Heuristic Functions
Depth-First Search
Input/Output
Context
Solution
Analysis
Breadth-First Search
Input/Output
Context
Solution
Analysis
A*Search
Input/Output
Context
Solution
Analysis
Variations
Comparing Search-Tree Algorithms
References
8. Network Flow Algorithms
Network Flow
Maximum Flow
Input/Output
Solution
Analysis
Optimization
Related Algorithms
Bipartite Matching
Input/Output
Solution
Analysis
Reflections on Augmenting Paths
Minimum Cost Flow
Transshipment
Solution
Transportation
Solution
Assignment
Solution
Linear Programming
References
9. Computational Geometry
Classifying Problems
Input Data
Computation
Nature of the Task
Assumptions
Convex Hull
Convex Hull Scan
Input/Output
Context
Solution
Analysis
Variations
Computing Line-Segment Intersections
LineSweep
Input/Output
Context
Solution
Analysis
Variations
Voronoi Diagram
Input/Output
Solution
Analysis
References
10. Spatial Tree Structures
Nearest Neighbor Queries
Range Queries
Intersection Queries
Spatial Tree Structures
k-d Tree
Quadtree
R-Tree
Nearest Neighbor Queries
Input/Output
Context
Solution
Analysis
Variations
Range Query
Input/Output
Context
Solution
Analysis
Quadtrees
Input/Output
Solution
Analysis
Variations
R-Trees
Input/Output
Context
Solution
Analysis
References
11. Emerging Algorithm Categories
Variations on a Theme
Approximation Algorithms
Input/Output
Context
Solution
Analysis
Parallel Algorithms
Probabilistic Algorithms
Estimating the Size of a Set
Estimating the Size of a Search Tree
References
12. Epilogue: Principles of Algorithms
Know Your Data
Decompose a Problem into Smaller Problems
Choose the Right Data Structure
Make the Space versus Time Trade-Off
Construct a Search
Reduce Your Problem to Another Problem
Writing Algorithms Is Hard—Testing Algorithms Is Harder
Accept Approximate Solutions When Possible
Add Parallelism to Increase Performance
A. Benchmarking
Statistical Foundation
Example
Java Benchmarking Solutions
Linux Benchmarking Solutions
Python Benchmarking Solutions
Reporting
Precision
Index
← Prev
Back
Next →
← Prev
Back
Next →