logo资料库

Introduction to Algorithms 3rd Edition.pdf

第1页 / 共1313页
第2页 / 共1313页
第3页 / 共1313页
第4页 / 共1313页
第5页 / 共1313页
第6页 / 共1313页
第7页 / 共1313页
第8页 / 共1313页
资料共1313页,剩余部分请下载后查看
Contents
Preface
I Foundations
1 The Role of Algorithms in Computing
2 Getting Started
3 Growth of Functions
4 Divide-and-Conquer
5 Probabilistic Analysis and Randomized Algorithms
II Sorting and Order Statistics
6 Heapsort
7 Quicksort
8 Sorting in Linear Time
9 Medians and Order Statistics
III Data Structures
10 Elementary Data Structures
10.1 Stacks and queues
10.2 Linked lists
10.3 Implementing pointers and objects
10.4 Representing rooted trees
Chapter notes
11 Hash Tables
12 Binary Search Trees
13 Red-Black Trees
14 Augmenting Data Structures
IV Advanced Design and Analysis Techniques
15 Dynamic Programming
16 Greedy Algorithms
17 Amortized Analysis
V Advanced Data Structures
18 B-Trees
19 Fibonacci Heaps
20 van Emde Boas Trees
21 Data Structures for Disjoint Sets
VI Graph Algorithms
22 Elementary Graph Algorithms
23 Minimum Spanning Trees
24 Single-Source Shortest Paths
25 All-Pairs Shortest Paths
26 Maximum Flow
VII Selected Topics
27 Multithreaded Algorithms
28 Matrix Operations
29 Linear Programming
30 Polynomials and the FFT
31 Number-Theoretic Algorithms
32 String Matching
33 Computational Geometry
34 NP-Completeness
35 Approximation Algorithms
VIII Appendix: Mathematical Background
A Summations
B Sets, Etc.
C Counting and Probability
D Matrices
Bibliography
Index
T H O M A S H. C O R M E N C H A R L E S E. L E I S E R S O N R O N A L D L . R I V E S T C L I F F O R D S T E I N I N T R O D U C T I O N T O A L G O R I T H M S T H I R D E D I T I O N
Introduction to Algorithms Third Edition
Thomas H. Cormen Charles E. Leiserson Ronald L. Rivest Clifford Stein Introduction to Algorithms Third Edition The MIT Press Cambridge, Massachusetts London, England
c 2009 Massachusetts Institute of Technology All rights reserved. No part of this book may be reproduced in any form or by any electronic or mechanical means (including photocopying, recording, or information storage and retrieval) without permission in writing from the publisher. For information about special quantity discounts, please email special sales@mitpress.mit.edu. This book was set in Times Roman and Mathtime Pro 2 by the authors. Printed and bound in the United States of America. Library of Congress Cataloging-in-Publication Data Introduction to algorithms / Thomas H. Cormen . . . [et al.].—3rd ed. p. cm. Includes bibliographical references and index. ISBN 978-0-262-03384-8 (hardcover : alk. paper)—ISBN 978-0-262-53305-8 (pbk. : alk. paper) 1. Computer programming. 2. Computer algorithms. I. Cormen, Thomas H. QA76.6.I5858 2009 005.1—dc22 10 9 8 7 6 5 4 3 2 2009008593
Contents Preface xiii I Foundations 1 2 3 4 16 11 3 5 Insertion sort Introduction The Role of Algorithms in Computing 5 1.1 Algorithms 1.2 Algorithms as a technology Getting Started 16 2.1 2.2 Analyzing algorithms 2.3 Designing algorithms Growth of Functions 43 3.1 Asymptotic notation 3.2 Divide-and-Conquer 65 4.1 The maximum-subarray problem 68 4.2 4.3 The substitution method for solving recurrences 4.4 The recursion-tree method for solving recurrences 4.5 The master method for solving recurrences Strassen’s algorithm for matrix multiplication Standard notations and common functions 23 29 43 53 75 93 83 88 114 ? 4.6 5 Proof of the master theorem 97 Probabilistic Analysis and Randomized Algorithms 5.1 The hiring problem 114 5.2 Indicator random variables 5.3 Randomized algorithms 118 122 ? 5.4 Probabilistic analysis and further uses of indicator random variables 130
vi Contents II Sorting and Order Statistics 6 7 8 156 162 151 147 151 Priority queues Introduction Heapsort 6.1 Heaps 6.2 Maintaining the heap property 6.3 Building a heap 6.4 The heapsort algorithm 159 6.5 Quicksort 170 7.1 Description of quicksort 7.2 Performance of quicksort 7.3 A randomized version of quicksort 7.4 Analysis of quicksort Sorting in Linear Time 191 8.1 Lower bounds for sorting 8.2 Counting sort 8.3 Radix sort 8.4 Bucket sort 170 174 197 200 180 191 194 154 179 9 Medians and Order Statistics 213 9.1 Minimum and maximum 214 9.2 9.3 Selection in expected linear time Selection in worst-case linear time 220 215 III Data Structures Introduction 229 10 Elementary Data Structures 232 10.1 Stacks and queues 10.2 Linked lists 236 10.3 Implementing pointers and objects 10.4 Representing rooted trees 246 232 241 11 Hash Tables 253 11.1 Direct-address tables 11.2 Hash tables 11.3 Hash functions 11.4 Open addressing ? 11.5 Perfect hashing 256 262 269 277 254
Contents vii 12 Binary Search Trees 286 12.1 What is a binary search tree? 12.2 Querying a binary search tree 12.3 Insertion and deletion 294 286 289 ? 12.4 Randomly built binary search trees 13 Red-Black Trees 308 299 13.1 Properties of red-black trees 13.2 Rotations 13.3 Insertion 13.4 Deletion 312 315 323 308 14 Augmenting Data Structures 14.1 Dynamic order statistics 14.2 How to augment a data structure 14.3 Interval trees 339 339 348 345 IV Advanced Design and Analysis Techniques Introduction 357 15 Dynamic Programming 360 359 15.1 Rod cutting 15.2 Matrix-chain multiplication 15.3 Elements of dynamic programming 15.4 Longest common subsequence 15.5 Optimal binary search trees 397 370 390 378 16 Greedy Algorithms 414 16.1 An activity-selection problem 415 16.2 Elements of the greedy strategy 16.3 Huffman codes 428 423 ? 16.4 Matroids and greedy methods ? 16.5 A task-scheduling problem as a matroid 17 Amortized Analysis 451 437 443 17.1 Aggregate analysis 17.2 The accounting method 17.3 The potential method 17.4 Dynamic tables 463 452 456 459
分享到:
收藏