به نام خدا
سلام

سرفصل ها
Thomas H. Cormen Charles E. Leiserson Ronald L. Rivest Clifford Stein Introduction to Algorithms Third Edition The MIT Press Cambridge, Massachusetts London, England
Contents
Preface xiii
Introduction 3
1 The Role of Algorithms in Computing 5
1.1 Algorithms 5
1.2 Algorithms as a technology 11
2 Getting Started 16
2.1 Insertion sort 16
2.2 Analyzing algorithms 23
2.3 Designing algorithms 29
3 Growth of Functions 43
3.1 Asymptotic notation 43
3.2 Standard notations and common functions 53
4 Divide-and-Conquer 65
4.1 The maximum-subarray problem 68
4.2 Strassen’s algorithm for matrix multiplication 75
4.3 The substitution method for solving recurrences 83
4.4 The recursion-tree method for solving recurrences 88
4.5 The master method for solving recurrences 93
? 4.6 Proof of the master theorem 97
5 Probabilistic Analysis and Randomized Algorithms 114
5.1 The hiring problem 114
5.2 Indicator random variables 118
5.3 Randomized algorithms 122
5.4 Probabilistic analysis and further uses of indicator random variables 130
Introduction 147
6 Heapsort 151
6.1 Heaps 151
6.2 Maintaining the heap property 154
6.3 Building a heap 156
6.4 The heapsort algorithm 159
6.5 Priority queues 162
7 Quicksort 170
7.1 Description of quicksort 170
7.2 Performance of quicksort 174
7.3 A randomized version of quicksort 179
7.4 Analysis of quicksort 180
8 Sorting in Linear Time 191
8.1 Lower bounds for sorting 191
8.2 Counting sort 194
8.3 Radix sort 197
8.4 Bucket sort 200
9 Medians and Order Statistics 213
9.1 Minimum and maximum 214
9.2 Selection in expected linear time 215
9.3 Selection in worst-case linear time 22
Introduction 229
10 Elementary Data Structures 232
10.1 Stacks and queues 232
10.2 Linked lists 236
10.3 Implementing pointers and objects 241
10.4 Representing rooted trees 246
11 Hash Tables 253
11.1 Direct-address tables 254
11.2 Hash tables 256
11.3 Hash functions 262
11.4 Open addressing 269
11.5 Perfect hashing 277
12 Binary Search Trees 286
12.1 What is a binary search tree 286
12.2 Querying a binary search tree 289
12.3 Insertion and deletion 294
12.4 Randomly built binary search trees 299
13 Red-Black Trees 308
13.1 Properties of red-black trees 308
13.2 Rotations 312
13.3 Insertion 315
13.4 Deletion 323
14 Augmenting Data Structures 339
14.1 Dynamic order statistics 339
14.2 How to augment a data structure 345
14.3 Interval trees 348
Introduction 357
15 Dynamic Programming 359
15.1 Rod cutting 360
15.2 Matrix-chain multiplication 370
15.3 Elements of dynamic programming 378
15.4 Longest common subsequence 390
15.5 Optimal binary search trees 397
16 Greedy Algorithms 414
16.1 An activity-selection problem 415
16.2 Elements of the greedy strategy 423
16.3 Huffman codes 428
16.4 Matroids and greedy methods 437
16.5 A task-scheduling problem as a matroid 443
17 Amortized Analysis 451
17.1 Aggregate analysis 452
17.2 The accounting method 456
17.3 The potential method 459
17.4 Dynamic tables 463
Introduction 481
18 B-Trees 484
18.1 Definition of B-trees 488
18.2 Basic operations on B-trees 491
18.3 Deleting a key from a B-tree 499
19 Fibonacci Heaps 505
19.1 Structure of Fibonacci heaps 507
19.2 Mergeable-heap operations 510
19.3 Decreasing a key and deleting a node 518
19.4 Bounding the maximum degree 523
20 van Emde Boas Trees 531
20.1 Preliminary approaches 532
20.2 A recursive structure 536
20.3 The van Emde Boas tree 545
21 Data Structures for Disjoint Sets 561
21.1 Disjoint-set operations 561
21.2 Linked-list representation of disjoint sets 564
21.3 Disjoint-set forests 568
21.4 Analysis of union by rank with path compression 57
Introduction 587
22 Elementary Graph Algorithms 589
22.1 Representations of graphs 589
22.2 Breadth-first search 594
22.3 Depth-first search 603
22.4 Topological sort 612
22.5 Strongly connected components 615
23 Minimum Spanning Trees 624
23.1 Growing a minimum spanning tree 625
23.2 The algorithms of Kruskal and Prim 631
24 Single-Source Shortest Paths 643
24.1 The Bellman-Ford algorithm 651
24.2 Single-source shortest paths in directed acyclic graphs 655
24.3 Dijkstra’s algorithm 658
24.4 Difference constraints and shortest paths 664
24.5 Proofs of shortest-paths properties 671
25 All-Pairs Shortest Paths 684
25.1 Shortest paths and matrix multiplication 686
25.2 The Floyd-Warshall algorithm 693
25.3 Johnson’s algorithm for sparse graphs 700
26 Maximum Flow 708
26.1 Flow networks 709
26.2 The Ford-Fulkerson method 714
26.3 Maximum bipartite matching 732
26.4 Push-relabel algorithms 736
26.5 The relabel-to-front algorithm 74
Introduction 769
27 Multithreaded Algorithms 772
27.1 The basics of dynamic multithreading 774
27.2 Multithreaded matrix multiplication 792
27.3 Multithreaded merge sort 797
28 Matrix Operations 813
28.1 Solving systems of linear equations 813
28.2 Inverting matrices 827
28.3 Symmetric positive-definite matrices and least-squares approximation 832
29 Linear Programming 843
29.1 Standard and slack forms 850
29.2 Formulating problems as linear programs 859
29.3 The simplex algorithm 864
29.4 Duality 879
29.5 The initial basic feasible solution 886 x Contents
30 Polynomials and the FFT 898
30.1 Representing polynomials 900
30.2 The DFT and FFT 906
30.3 Efficient FFT implementations 915
31 Number-Theoretic Algorithms 926
31.1 Elementary number-theoretic notions 927
31.2 Greatest common divisor 933
31.3 Modular arithmetic 939
31.4 Solving modular linear equations 946
31.5 The Chinese remainder theorem 950
31.6 Powers of an element 954
31.7 The RSA public-key cryptosystem 958
31.8 Primality testing 965
31.9 Integer factorization 975
32 String Matching 985
32.1 The naive string-matching algorithm 988
32.2 The Rabin-Karp algorithm 990
32.3 String matching with finite automata 995
32.4 The Knuth-Morris-Pratt algorithm 1002
33 Computational Geometry 1014
33.1 Line-segment properties 1015
33.2 Determining whether any pair of segments intersects 1021
33.3 Finding the convex hull 1029
33.4 Finding the closest pair of points 1039
34 NP-Completeness 1048
34.1 Polynomial time 1053
34.2 Polynomial-time verification 1061
34.3 NP-completeness and reducibility 1067
34.4 NP-completeness proofs 1078
34.5 NP-complete problems 1086
35 Approximation Algorithms 1106
35.1 The vertex-cover problem 1108
35.2 The traveling-salesman problem 1111
35.3 The set-covering problem 1117
35.4 Randomization and linear programming 1123
35.5 The subset-sum problem 1128
VIII Appendix: Mathematical Background
Introduction 1143
A Summations 1145
A.1 Summation formulas and properties 1145
A.2 Bounding summations 1149
B Sets, Etc. 1158
B.1 Sets 1158
B.2 Relations 1163
B.3 Functions 1166
B.4 Graphs 1168
B.5 Trees 1173
C Counting and Probability 1183
C.1 Counting 1183
C.2 Probability 1189
C.3 Discrete random variables 1196
C.4 The geometric and binomial distributions 1201
C.5 The tails of the binomial distribution 1208
D Matrices 1217
D.1 Matrices and matrix operations 1217
D.2 Basic matrix properties 1222
Bibliography 1231
Index 1251
سرفصل ها به فارسی

فهرست
پیشگفتار xiii
بنیادها I
مقدمه 3
1 نقش الگوریتم ها در محاسبات 5
1.1 الگوریتم ها 5
1.2 الگوریتم ها به عنوان یک فناوری 11
2 شروع 16
2.1 مرتب سازی درج 16
2.2 تجزیه و تحلیل الگوریتم ها 23
2.3 طراحی الگوریتم ها 29
3 رشد توابع 43
3.1 نماد مجانبی 43
3.2 نمادهای استاندارد و توابع رایج 53
4 تقسیم کن 65
4.1 مشکل حداکثر زیرآری 68
4.2 الگوریتم استراسن برای ضرب ماتریس 75
4.3 روش جایگزینی برای حل عودها 83
4.4 روش درخت بازگشتی برای حل عودها 88
4.5 روش اصلی برای حل عودها 93
4.6 اثبات قضیه اصلی 97
5 تحلیل احتمالی و الگوریتم های تصادفی 114
5.1 مشکل استخدام 114
5.2 متغیرهای تصادفی شاخص 118
5.3 الگوریتم های تصادفی 122
5.4 تحلیل احتمالی و استفاده بیشتر از متغیرهای تصادفی شاخص 130
مقدمه 147
6 مرتب سازی هیپ 151
6.1 مرتب سازی هیپ 151
6.2 حفظ خاصیت هیپ 154
6.3 ساختن پشته 156
6.4 الگوریتم مرتب سازی هیپ 159
6.5 صف های اولویت دار 162
7 مرتب سازی سریع 170
7.1 شرح مرتب سازی سریع 170
7.2 عملکرد مرتب سازی سریع 174
7.3 یک نسخه تصادفی از مرتب سازی سریع 179
7.4 تجزیه و تحلیل مرتب سازی سریع 180
8 مرتب سازی در زمان خطی 191
8.1 مرزهای پایین برای مرتب سازی 191
8.2 مرتب سازی شمارش 194
8.3 مرتب سازی ریشه 197
8.4 مرتب سازی سطلی 200
9 میانه و آمار سفارش 213
9.1 حداقل و حداکثر 214
9.2 انتخاب در زمان خطی مورد انتظار 215
9.3 انتخاب در بدترین حالت خطی زمان 22
مقدمه 229
10 ساختار داده های ابتدایی 232
10.1 پشته ها و صف ها 232
10.2 لیست های پیوندی 236
10.3 پیاده سازی اشاره گرها و اشیاء 241
10.4 به نمایندگی از درختان ریشه دار 246
11 جدول هش 253
11.1 جداول آدرس مستقیم 254
11.2 جداول هش 256
11.3 توابع هش 262
11.4 آدرس 269 را باز کنید
11.5 هش کامل 277
12 درخت جستجوی باینری 286
12.1 درخت جستجوی باینری چیست 286
12.2 پرس و جو از درخت جستجوی دودویی 289
12.3 درج و حذف 294
12.4 درختان جستجوی باینری تصادفی ساخته شده 299
13 درخت قرمز-سیاه 308
13.1 خواص درختان سرخ سیاه 308
13.2 چرخش 312
13.3 درج 315
13.4 حذف 323
14 تقویت ساختارهای داده 339
14.1 آمار سفارش پویا 339
14.2 نحوه تقویت ساختار داده 345
14.3 درختان فاصله 348
مقدمه 357
15 برنامه نویسی پویا 359
15.1 میله برش 360
15.2 ضرب ماتریس زنجیره 370
15.3 عناصر برنامه نویسی پویا 378
15.4 طولانی ترین دنباله متداول 390
15.5 درخت های جستجوی باینری بهینه 397
16 الگوریتم حریص 414
16.1 مسئله انتخاب فعالیت 415
16.2 عناصر استراتژی حریصانه 423
16.3 کد هافمن 428
16.4 ماتروئیدها و روش های حریصانه 437
16.5 یک مشکل زمان بندی کار به عنوان یک ماتروئید 443
17 تحلیل مستهلک 451
17.1 تجزیه و تحلیل کل 452
17.2 روش حسابداری 456
17.3 روش بالقوه 459
17.4 جداول پویا 463 17 تحلیل مستهلک 451
17.1 تجزیه و تحلیل کل 452
17.2 روش حسابداری 456
17.3 روش بالقوه 459
17.4 جداول پویا 463
ساختارهای داده پیشرفته
مقدمه 481
18 درختان بی 484
18.1 تعریف درختان بی 488
18.2 عملیات اساسی در درختان بی 491
18.3 حذف یک کلید از درخت بی 499
19 فیبوناچی هیپس 505
19.1 ساختار پشته های فیبوناچی 507
19.2 عملیات هیپ قابل ادغام 510
19.3 کاهش یک کلید و حذف یک گره 518
19.4 محدود کردن حداکثر درجه 523
20 درختان ای ام دی ای بواس 531
20.1 رویکردهای اولیه 532
20.2 ساختار بازگشتی 536
20.3 درخت ای ام دی ای بواس 543
21 ساختار داده برای مجموعه های مجزا 561
21.1 عملیات مجزا 561
21.2 نمایش لیست پیوندی مجموعههای مجزا 564
21.3 جنگل های منفصل 568
21.4 تجزیه و تحلیل اتحاد بر اساس رتبه با فشرده سازی مسیر 57
مقدمه 587
22 الگوریتم گراف ابتدایی 589
22.1 نمایش گراف ها 589
22.2 جستجوی اول عرض 594
22.3 جستجوی اول عمق 603
22.4 مرتب سازی توپولوژیکی 612
22.5 قطعات با اتصال قوی 615
23 حداقل درخت پوشا 624
23.1 رشد حداقل درخت پوشا 625
23.2 الگوریتم های کروسکال و پریم 631
24 کوتاهترین مسیرهای تک منبعی 643
24.1 الگوریتم بلمن-فورد 651
24.2 کوتاهترین مسیرهای تک منبعی در گراف های غیر چرخه ای جهت دار 655
24.3 الگوریتم دایکسترا 658
24.4 محدودیت های تفاوت و کوتاه ترین مسیرها 664
24.5 اثبات ویژگی های کوتاه ترین مسیر 671
25 همه جفت کوتاه ترین مسیرها 684
25.1 کوتاه ترین مسیرها و ضرب ماتریس 686
25.2 الگوریتم فلوید-وارشال 693
25.3 الگوریتم جانسون برای گراف های پراکنده 700
26 حداکثر جریان 708
26.1 شبکه های جریان 709
26.2 روش فورد-فولکرسون 714
26.3 حداکثر تطبیق دوبخشی 732
26.4 الگوریتم های پوش ریلبل 736
26.5 الگوریتم ریلبل تو فرانت 74
مقدمه 769
27 الگوریتم چند رشته ای 772
27.1 اصول اولیه چند رشته ای پویا 774
27.2 ضرب ماتریس چند رشته ای 792
27.3 مرتب سازی ادغام چند رشته ای 797
28 عملیات ماتریس 813
28.1 حل سیستم معادلات خطی 813
28.2 معکوس کردن ماتریس 827
28.3 ماتریس های متقارن مثبت-معین و تقریب حداقل مربعات 832
29 برنامه نویسی خطی 843
29.1 فرم استاندارد و اسلک 850
29.2 فرمول بندی مسائل به عنوان برنامه های خطی 859
29.3 الگوریتم سیمپلکس 864
29.4 دوآلیتی 879
29.5 راه حل اولیه اولیه امکان پذیر 886 x محتویات
30 چند جمله ای و اف اف تی 898
30.1 نمایش چند جمله ای 900
30.2 "اف اف تی" و "دی اف تی" 906
30.3 اجرای کارآمد اف اف تی 915
31 الگوریتم های نظریه اعداد 926
31.1 مفاهیم ابتدایی اعداد نظریه 927
31.2 بزرگترین مقسوم علیه مشترک 933
31.3 محاسبات مدولار 939
31.4 حل معادلات خطی مدولار 946
31.5 قضیه باقیمانده چینی 950
31.6 قدرت های یک عنصر 954
31.7 سیستم رمزنگاری کلید عمومی RSA 958
31.8 تست اولیه 965
31.9 فاکتورسازی اعداد صحیح 975
32 رشته تطبیق 985
32.1 الگوریتم تطبیق رشته ساده 988
32.2 الگوریتم رابین-کارپ 990
32.3 تطبیق رشته با اتوماتای محدود 995
32.4 الگوریتم نوت مورس پرات 1002
33 هندسه محاسباتی 1014
33.1 ویژگی های بخش خط 1015
33.2 تعیین اینکه آیا هر جفت قطعه 1021 را قطع می کند یا خیر
33.3 یافتن بدنه محدب 1029
33.4 یافتن نزدیکترین جفت نقطه 1039
34 "ان پی کاملیت نس" 1048
34.1 زمان چند جمله ای 1053
34.2 راستیآزمایی زمان چند جملهای 1061
34.3 ان پی - 1067 کاملیت و کاهش پذیری
34.4 اثبات کامل بودن "ان پی" 1078
34.5 مسائل NP-کامل 1086
35 الگوریتم تقریب 1106
35.1 مسئله پوشش راس 1108
35.2 مسئله فروشنده دوره گرد 1111
35.3 مسئله پوشش مجموعه 1117
35.4 تصادفی سازی و برنامه ریزی خطی 1123
35.5 مسئله جمع زیر مجموعه 1128
مقدمه 1143
الف . جمع بندی 1145
الف.1 فرمول ها و خصوصیات جمع 1145
الف.2 مجموع کران 1149
ب . مجموعه ها و غیره 1158
ب.1 مجموعه ها 1158
ب.2 روابط 1163
ب.3 توابع 1166
ب.4 گراف ها 1168
ب.۵ درختان ۱۱۷۳
ج شمارش و احتمال 1183
ج.1 شمارش 1183
ج.2 احتمال 1189
ج.3 متغیرهای تصادفی گسسته 1196
ج.4 توزیع های هندسی و دوجمله ای 1201
ج.5 دنباله های توزیع دوجمله ای 1208
د . ماتریس 1217
د.1 ماتریس و عملیات ماتریس 1217
د.2 ویژگی های اساسی ماتریس 1222
کتابشناسی 1231
فهرست 1251
منبع
موفق باشید
به امید خدا