Instructor’s Manual
by Thomas H. Cormen
to Accompany
Introduction to Algorithms
Fourth Edition
by Thomas H. Cormen
Charles E. Leiserson
Ronald L. Rivest
Clifford Stein
The MIT Press
Cambridge, Massachusetts London, England
,Instructor’s Manual to Accompany Introduction to Algorithms, Fourth Edition
by Thomas H. Cormen, Charles E. Leiserson, Ronald L. Rivest, and Clifford Stein
Published by the MIT Press. Copyright © 2022 by The Massachusetts Institute of Technology. All rights reserved.
No part of this publication may be reproduced or distributed in any form or by any means, or stored in a database
or retrieval system, without the prior written consent of The MIT Press, including, but not limited to, network or
other electronic storage or transmission, or broadcast for distance learning.
,Contents
Revision History R-1
Preface P-1
Chapter 2: Getting Started
Lecture Notes 2-1
Solutions 2-20
Chapter 3: Characterizing Running Times
Lecture Notes 3-1
Solutions 3-11
Chapter 4: Divide-and-Conquer
Lecture Notes 4-1
Solutions 4-16
Chapter 5: Probabilistic Analysis and Randomized Algorithms
Lecture Notes 5-1
Solutions 5-9
Chapter 6: Heapsort
Lecture Notes 6-1
Solutions 6-11
Chapter 7: Quicksort
Lecture Notes 7-1
Solutions 7-9
Chapter 8: Sorting in Linear Time
Lecture Notes 8-1
Solutions 8-9
Chapter 9: Medians and Order Statistics
Lecture Notes 9-1
Solutions 9-11
Chapter 10: Elementary Data Structures
Lecture Notes 10-1
Solutions 10-11
Chapter 11: Hash Tables
Lecture Notes 11-1
Solutions 11-21
Chapter 12: Binary Search Trees
Lecture Notes 12-1
Solutions 12-10
Chapter 13: Red-Black Trees
Lecture Notes 13-1
Solutions 13-14
, iv Contents
Chapter 14: Dynamic Programming
Lecture Notes 14-1
Solutions 14-25
Chapter 15: Greedy Algorithms
Lecture Notes 15-1
Solutions 15-15
Chapter 16: Amortized Analysis
Lecture Notes 16-1
Solutions 16-14
Chapter 17: Augmenting Data Structures
Lecture Notes 17-1
Solutions 17-10
Chapter 19: Data Structures for Disjoint Sets
Lecture Notes 19-1
Solutions 19-7
Chapter 20: Elementary Graph Algorithms
Lecture Notes 20-1
Solutions 20-15
Chapter 21: Minimum Spanning Trees
Lecture Notes 21-1
Solutions 21-8
Chapter 22: Single-Source Shortest Paths
Lecture Notes 22-1
Solutions 22-13
Chapter 23: All-Pairs Shortest Paths
Lecture Notes 23-1
Solutions 23-9
Chapter 24: Maximum Flow
Lecture Notes 24-1
Solutions 24-12
Chapter 25: Matchings in Bipartite Graphs
Lecture Notes 25-1
Solutions 25-24
Chapter 26: Parallel Algorithms
Solutions 26-1
Chapter 30: Polynomials and the FFT
Lecture Notes 30-1
Solutions 30-15
Chapter 32: String Matching
Lecture Notes 32-1
Solutions 32-15
Chapter 35: Approximation Algorithms
Lecture Notes 35-1
Solutions 35-18
by Thomas H. Cormen
to Accompany
Introduction to Algorithms
Fourth Edition
by Thomas H. Cormen
Charles E. Leiserson
Ronald L. Rivest
Clifford Stein
The MIT Press
Cambridge, Massachusetts London, England
,Instructor’s Manual to Accompany Introduction to Algorithms, Fourth Edition
by Thomas H. Cormen, Charles E. Leiserson, Ronald L. Rivest, and Clifford Stein
Published by the MIT Press. Copyright © 2022 by The Massachusetts Institute of Technology. All rights reserved.
No part of this publication may be reproduced or distributed in any form or by any means, or stored in a database
or retrieval system, without the prior written consent of The MIT Press, including, but not limited to, network or
other electronic storage or transmission, or broadcast for distance learning.
,Contents
Revision History R-1
Preface P-1
Chapter 2: Getting Started
Lecture Notes 2-1
Solutions 2-20
Chapter 3: Characterizing Running Times
Lecture Notes 3-1
Solutions 3-11
Chapter 4: Divide-and-Conquer
Lecture Notes 4-1
Solutions 4-16
Chapter 5: Probabilistic Analysis and Randomized Algorithms
Lecture Notes 5-1
Solutions 5-9
Chapter 6: Heapsort
Lecture Notes 6-1
Solutions 6-11
Chapter 7: Quicksort
Lecture Notes 7-1
Solutions 7-9
Chapter 8: Sorting in Linear Time
Lecture Notes 8-1
Solutions 8-9
Chapter 9: Medians and Order Statistics
Lecture Notes 9-1
Solutions 9-11
Chapter 10: Elementary Data Structures
Lecture Notes 10-1
Solutions 10-11
Chapter 11: Hash Tables
Lecture Notes 11-1
Solutions 11-21
Chapter 12: Binary Search Trees
Lecture Notes 12-1
Solutions 12-10
Chapter 13: Red-Black Trees
Lecture Notes 13-1
Solutions 13-14
, iv Contents
Chapter 14: Dynamic Programming
Lecture Notes 14-1
Solutions 14-25
Chapter 15: Greedy Algorithms
Lecture Notes 15-1
Solutions 15-15
Chapter 16: Amortized Analysis
Lecture Notes 16-1
Solutions 16-14
Chapter 17: Augmenting Data Structures
Lecture Notes 17-1
Solutions 17-10
Chapter 19: Data Structures for Disjoint Sets
Lecture Notes 19-1
Solutions 19-7
Chapter 20: Elementary Graph Algorithms
Lecture Notes 20-1
Solutions 20-15
Chapter 21: Minimum Spanning Trees
Lecture Notes 21-1
Solutions 21-8
Chapter 22: Single-Source Shortest Paths
Lecture Notes 22-1
Solutions 22-13
Chapter 23: All-Pairs Shortest Paths
Lecture Notes 23-1
Solutions 23-9
Chapter 24: Maximum Flow
Lecture Notes 24-1
Solutions 24-12
Chapter 25: Matchings in Bipartite Graphs
Lecture Notes 25-1
Solutions 25-24
Chapter 26: Parallel Algorithms
Solutions 26-1
Chapter 30: Polynomials and the FFT
Lecture Notes 30-1
Solutions 30-15
Chapter 32: String Matching
Lecture Notes 32-1
Solutions 32-15
Chapter 35: Approximation Algorithms
Lecture Notes 35-1
Solutions 35-18