Preface
Introduction
Why Study Algorithms?
Integer Multiplication
Karatsuba Multiplication
MergeSort: The Algorithm
MergeSort: The Analysis
Guiding Principles for the Analysis of Algorithms
Problems
Asymptotic Notation
The Gist
Big-O Notation
Two Basic Examples
Big-Omega and Big-Theta Notation
Additional Examples
Problems
Divide-and-Conquer Algorithms
The Divide-and-Conquer Paradigm
Counting Inversions in O(n logn) Time
Strassen's Matrix Multiplication Algorithm
An O(n logn)-Time Algorithm for the Closest Pair
Problems
The Master Method
Integer Multiplication Revisited
Formal Statement
Six Examples
Proof of the Master Method
Problems
QuickSort
Overview
Partitioning Around a Pivot Element
The Importance of Good Pivots
Randomized QuickSort
Analysis of Randomized QuickSort
Sorting Requires (n logn) Comparisons
Problems
Linear-Time Selection
The RSelect Algorithm
Analysis of RSelect
The DSelect Algorithm
Analysis of DSelect
Problems
Quick Review of Proofs By Induction
A Template for Proofs by Induction
Example: A Closed-Form Formula
Example: The Size of a Complete Binary Tree
Quick Review of Discrete Probability
Sample Spaces
Events
Random Variables
Expectation
Linearity of Expectation
Example: Load Balancing
Index