100% found this document useful (3 votes)
42 views

Test bank for Data Structures and Algorithms in C++ 2nd Edition by Goodrichpdf download

The document provides information about the Test Bank for 'Data Structures and Algorithms in C++ 2nd Edition' by Goodrich, available for download on TestBankBell.com. It outlines the book's focus on data structures and algorithms with an emphasis on object-oriented design using C++, and details the authors' backgrounds. Additionally, it includes links to various solution manuals and academic resources related to data structures and algorithms.

Uploaded by

rahelikarimu
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (3 votes)
42 views

Test bank for Data Structures and Algorithms in C++ 2nd Edition by Goodrichpdf download

The document provides information about the Test Bank for 'Data Structures and Algorithms in C++ 2nd Edition' by Goodrich, available for download on TestBankBell.com. It outlines the book's focus on data structures and algorithms with an emphasis on object-oriented design using C++, and details the authors' backgrounds. Additionally, it includes links to various solution manuals and academic resources related to data structures and algorithms.

Uploaded by

rahelikarimu
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 41

Test bank for Data Structures and Algorithms in

C++ 2nd Edition by Goodrich download

http://testbankbell.com/product/test-bank-for-data-structures-
and-algorithms-in-c-2nd-edition-by-goodrich/
TestBankBell.com: Your Ultimate Source for Test Banks and Academic Resources

TestBankBell.com is a leading online platform offering instant access to a wide


variety of test banks and academic resources. Whether you're a student, educator, or
professional, we provide the tools and materials you need to excel in your studies and
career. Our website features test banks for textbooks across multiple disciplines,
offering comprehensive solutions to enhance your learning experience.

Keywords:
test bank, academic resources, study guides, test preparation, testbankbell, download test
bank, textbook solutions

Contact Information:
Visit us at: https://testbankbell.com - For inquiries, email us:
testbankbell.com@gmail.com

Important Links:
Download Test Banks: https://testbankbell.com/

Copyright © 2025 TestBankBell. All Rights Reserved.


Instant digital products (PDF, ePub, MOBI) ready for you
Download now and discover formats that fit your needs...

Start reading on any device today!

Solution Manual for Data Structures and Algorithms in Java


1st Edition, Peter Drake

https://testbankbell.com/product/solution-manual-for-data-structures-
and-algorithms-in-java-1st-edition-peter-drake/

testbankbell.com

Solution Manual for Data Structures and Algorithm Analysis


in C, 2/E 2nd Edition : 0201498405

https://testbankbell.com/product/solution-manual-for-data-structures-
and-algorithm-analysis-in-c-2-e-2nd-edition-0201498405/

testbankbell.com

Solution Manual for Data Structures and Algorithm Analysis


in C++, 4/E 4th Edition : 013284737X

https://testbankbell.com/product/solution-manual-for-data-structures-
and-algorithm-analysis-in-c-4-e-4th-edition-013284737x/

testbankbell.com

Solution Manual for Data Structures and Problem Solving


Using C++ 2/E Mark A. Weiss

https://testbankbell.com/product/solution-manual-for-data-structures-
and-problem-solving-using-c-2-e-mark-a-weiss/

testbankbell.com
Test Bank for Fundamentals of Python: Data Structures 2nd
Edition Kenneth Lambert

https://testbankbell.com/product/test-bank-for-fundamentals-of-python-
data-structures-2nd-edition-kenneth-lambert/

testbankbell.com

Solution Manual for Data Structures and Other Objects


Using C++, 4/E Michael Main, Walter Savitch

https://testbankbell.com/product/solution-manual-for-data-structures-
and-other-objects-using-c-4-e-michael-main-walter-savitch/

testbankbell.com

Solution Manual for C++ Programming: Program Design


Including Data Structures, 6th Edition D.S. Malik

https://testbankbell.com/product/solution-manual-for-c-programming-
program-design-including-data-structures-6th-edition-d-s-malik/

testbankbell.com

Solution Manual for Fundamentals of Python: Data


Structures, 2nd Edition Kenneth Lambert

https://testbankbell.com/product/solution-manual-for-fundamentals-of-
python-data-structures-2nd-edition-kenneth-lambert/

testbankbell.com

Solution manual for Fundamentals of Python: Data


Structures 1st Edition by Lambert

https://testbankbell.com/product/solution-manual-for-fundamentals-of-
python-data-structures-1st-edition-by-lambert/

testbankbell.com
Test bank for Data Structures and Algorithms in
C++ 2nd Edition by Goodrich
Full download link at: https://testbankbell.com/product/test-bank-for-data-
structures-and-algorithms-in-c-2nd-edition-by-goodrich/

Description:
This second edition of Data Structures and Algorithms in C++ is designed to
provide an introduction to data structures and algorithms, including their design,
analysis, and implementation. The authors offer an introduction to object-
oriented design with C++ and design patterns, including the use of class
inheritance and generic programming through class and function templates, and
retain a consistent object-oriented viewpoint throughout the book. This is a sister
book to Goodrich s Data Structures and Algorithms in Java, but uses C++ as the
basis language instead of Java. This C++ version retains the same pedagogical
approach and general structure as the Java version so schools that teach data
structures in both C++ and Java can share the same core syllabus. In terms of
curricula based on the IEEE/ACM 2001 Computing Curriculum, this book is
appropriate for use in the courses CS102 (I/O/B versions), CS103 (I/O/B versions),
CS111 (A version), and CS112 (A/I/O/F/H versions).
About the Author
Michael Goodrich received his Ph.D. in computer science from Purdue University
in 1987. He is currently a professor in the Department of Computer Science at
University of California, Irvine. Previously, he was a professor at Johns Hopkins
University. He is an editor for the International Journal of Computational
Geometry & Applications and Journal of Graph Algorithms and Applications.
Roberto Tamassia received his Ph.D. in Electrical and Computer Engineering from
the University of Illinois at Urbana-Champaign in 1988. He is currently a professor
in the Department of Computer Science at Brown University. He is editor-in-chief
for the Journal of Graph Algorithms and Applications and an editor
for Computational Geometry: Theory and Applications. He previously served on
the editorial board of IEEE Transactions on Computers.
--This text refers to the paperback edition.
• ISBN-10 : 0470383275
• ISBN-13 : 978-0470383278

Table contents:
1 A C++ Primer 1
1.1 Basic C++ Programming Elements . . . . . . . . . . . . . . . 2
1.1.1 A Simple C++ Program . . . . . . . . . . . . . . . . . . 2
1.1.2 Fundamental Types . . . . . . . . . . . . . . . . . . . . 4
1.1.3 Pointers, Arrays, and Structures . . . . . . . . . . . . . 7
1.1.4 Named Constants, Scope, and Namespaces . . . . . . . 13
1.2 Expressions . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
1.2.1 Changing Types through Casting . . . . . . . . . . . . . 20
1.3 Control Flow . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
1.4 Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
1.4.1 Argument Passing . . . . . . . . . . . . . . . . . . . . . 28
1.4.2 Overloading and Inlining . . . . . . . . . . . . . . . . . 30
1.5 Classes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
1.5.1 Class Structure . . . . . . . . . . . . . . . . . . . . . . 33
1.5.2 Constructors and Destructors . . . . . . . . . . . . . . . 37
1.5.3 Classes and Memory Allocation . . . . . . . . . . . . . . 40
1.5.4 Class Friends and Class Members . . . . . . . . . . . . . 43
1.5.5 The Standard Template Library . . . . . . . . . . . . . . 45
1.6 C++ Program and File Organization . . . . . . . . . . . . . . 47
1.6.1 An Example Program . . . . . . . . . . . . . . . . . . . 48
1.7 Writing a C++ Program . . . . . . . . . . . . . . . . . . . . . 53
1.7.1 Design . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
1.7.2 Pseudo-Code . . . . . . . . . . . . . . . . . . . . . . . 54
1.7.3 Coding . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
1.7.4 Testing and Debugging . . . . . . . . . . . . . . . . . . 57
1.8 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
2 Object-Oriented Design 65
2.1 Goals, Principles, and Patterns . . . . . . . . . . . . . . . . 66
2.1.1 Object-Oriented Design Goals . . . . . . . . . . . . . . 66
2.1.2 Object-Oriented Design Principles . . . . . . . . . . . . 67
2.1.3 Design Patterns . . . . . . . . . . . . . . . . . . . . . . 70
xv
xvi Contents
2.2 Inheritance and Polymorphism . . . . . . . . . . . . . . . . . 71
2.2.1 Inheritance in C++ . . . . . . . . . . . . . . . . . . . . . 71
2.2.2 Polymorphism . . . . . . . . . . . . . . . . . . . . . . . 78
2.2.3 Examples of Inheritance in C++ . . . . . . . . . . . . . . 79
2.2.4 Multiple Inheritance and Class Casting . . . . . . . . . . 84
2.2.5 Interfaces and Abstract Classes . . . . . . . . . . . . . . 87
2.3 Templates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90
2.3.1 Function Templates . . . . . . . . . . . . . . . . . . . . 90
2.3.2 Class Templates . . . . . . . . . . . . . . . . . . . . . . 91
2.4 Exceptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93
2.4.1 Exception Objects . . . . . . . . . . . . . . . . . . . . . 93
2.4.2 Throwing and Catching Exceptions . . . . . . . . . . . . 94
2.4.3 Exception Specification . . . . . . . . . . . . . . . . . . 96
2.5 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98
3 Arrays, Linked Lists, and Recursion 103
3.1 Using Arrays . . . . . . . . . . . . . . . . . . . . . . . . . . . 104
3.1.1 Storing Game Entries in an Array . . . . . . . . . . . . . 104
3.1.2 Sorting an Array . . . . . . . . . . . . . . . . . . . . . . 109
3.1.3 Two-Dimensional Arrays and Positional Games . . . . . 111
3.2 Singly Linked Lists . . . . . . . . . . . . . . . . . . . . . . . . 117
3.2.1 Implementing a Singly Linked List . . . . . . . . . . . . 117
3.2.2 Insertion to the Front of a Singly Linked List . . . . . . 119
3.2.3 Removal from the Front of a Singly Linked List . . . . . 119
3.2.4 Implementing a Generic Singly Linked List . . . . . . . . 121
3.3 Doubly Linked Lists . . . . . . . . . . . . . . . . . . . . . . . 123
3.3.1 Insertion into a Doubly Linked List . . . . . . . . . . . . 123
3.3.2 Removal from a Doubly Linked List . . . . . . . . . . . 124
3.3.3 A C++ Implementation . . . . . . . . . . . . . . . . . . 125
3.4 Circularly Linked Lists and List Reversal . . . . . . . . . . . 129
3.4.1 Circularly Linked Lists . . . . . . . . . . . . . . . . . . . 129
3.4.2 Reversing a Linked List . . . . . . . . . . . . . . . . . . 133
3.5 Recursion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 134
3.5.1 Linear Recursion . . . . . . . . . . . . . . . . . . . . . . 140
3.5.2 Binary Recursion . . . . . . . . . . . . . . . . . . . . . 144
3.5.3 Multiple Recursion . . . . . . . . . . . . . . . . . . . . 147
3.6 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 149
4 Analysis Tools 153
4.1 The Seven Functions Used in This Book . . . . . . . . . . . 154
4.1.1 The Constant Function . . . . . . . . . . . . . . . . . . 154
4.1.2 The Logarithm Function . . . . . . . . . . . . . . . . . 154
Contents xvii
4.1.3 The Linear Function . . . . . . . . . . . . . . . . . . . . 156
4.1.4 The N-Log-N Function . . . . . . . . . . . . . . . . . . 156
4.1.5 The Quadratic Function . . . . . . . . . . . . . . . . . . 156
4.1.6 The Cubic Function and Other Polynomials . . . . . . . 158
4.1.7 The Exponential Function . . . . . . . . . . . . . . . . . 159
4.1.8 Comparing Growth Rates . . . . . . . . . . . . . . . . . 161
4.2 Analysis of Algorithms . . . . . . . . . . . . . . . . . . . . . 162
4.2.1 Experimental Studies . . . . . . . . . . . . . . . . . . . 163
4.2.2 Primitive Operations . . . . . . . . . . . . . . . . . . . 164
4.2.3 Asymptotic Notation . . . . . . . . . . . . . . . . . . . 166
4.2.4 Asymptotic Analysis . . . . . . . . . . . . . . . . . . . . 170
4.2.5 Using the Big-Oh Notation . . . . . . . . . . . . . . . . 172
4.2.6 A Recursive Algorithm for Computing Powers . . . . . . 176
4.2.7 Some More Examples of Algorithm Analysis . . . . . . . 177
4.3 Simple Justification Techniques . . . . . . . . . . . . . . . . 181
4.3.1 By Example . . . . . . . . . . . . . . . . . . . . . . . . 181
4.3.2 The “Contra” Attack . . . . . . . . . . . . . . . . . . . 181
4.3.3 Induction and Loop Invariants . . . . . . . . . . . . . . 182
4.4 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 185
5 Stacks, Queues, and Deques 193
5.1 Stacks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 194
5.1.1 The Stack Abstract Data Type . . . . . . . . . . . . . . 195
5.1.2 The STL Stack . . . . . . . . . . . . . . . . . . . . . . 196
5.1.3 A C++ Stack Interface . . . . . . . . . . . . . . . . . . 196
5.1.4 A Simple Array-Based Stack Implementation . . . . . . 198
5.1.5 Implementing a Stack with a Generic Linked List . . . . 202
5.1.6 Reversing a Vector Using a Stack . . . . . . . . . . . . . 203
5.1.7 Matching Parentheses and HTML Tags . . . . . . . . . 204
5.2 Queues . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 208
5.2.1 The Queue Abstract Data Type . . . . . . . . . . . . . 208
5.2.2 The STL Queue . . . . . . . . . . . . . . . . . . . . . . 209
5.2.3 A C++ Queue Interface . . . . . . . . . . . . . . . . . . 210
5.2.4 A Simple Array-Based Implementation . . . . . . . . . . 211
5.2.5 Implementing a Queue with a Circularly Linked List . . . 213
5.3 Double-Ended Queues . . . . . . . . . . . . . . . . . . . . . . 217
5.3.1 The Deque Abstract Data Type . . . . . . . . . . . . . 217
5.3.2 The STL Deque . . . . . . . . . . . . . . . . . . . . . . 218
5.3.3 Implementing a Deque with a Doubly Linked List . . . . 218
5.3.4 Adapters and the Adapter Design Pattern . . . . . . . . 220
5.4 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 223
xviii Contents
6 List and Iterator ADTs 227
6.1 Vectors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 228
6.1.1 The Vector Abstract Data Type . . . . . . . . . . . . . 228
6.1.2 A Simple Array-Based Implementation . . . . . . . . . . 229
6.1.3 An Extendable Array Implementation . . . . . . . . . . . 231
6.1.4 STL Vectors . . . . . . . . . . . . . . . . . . . . . . . . 236
6.2 Lists . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 238
6.2.1 Node-Based Operations and Iterators . . . . . . . . . . . 238
6.2.2 The List Abstract Data Type . . . . . . . . . . . . . . . 240
6.2.3 Doubly Linked List Implementation . . . . . . . . . . . . 242
6.2.4 STL Lists . . . . . . . . . . . . . . . . . . . . . . . . . 247
6.2.5 STL Containers and Iterators . . . . . . . . . . . . . . . 248
6.3 Sequences . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 255
6.3.1 The Sequence Abstract Data Type . . . . . . . . . . . . 255
6.3.2 Implementing a Sequence with a Doubly Linked List . . 255
6.3.3 Implementing a Sequence with an Array . . . . . . . . . 257
6.4 Case Study: Bubble-Sort on a Sequence . . . . . . . . . . . 259
6.4.1 The Bubble-Sort Algorithm . . . . . . . . . . . . . . . . 259
6.4.2 A Sequence-Based Analysis of Bubble-Sort . . . . . . . . 260
6.5 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 262
7 Trees 267
7.1 General Trees . . . . . . . . . . . . . . . . . . . . . . . . . . . 268
7.1.1 Tree Definitions and Properties . . . . . . . . . . . . . . 269
7.1.2 Tree Functions . . . . . . . . . . . . . . . . . . . . . . . 272
7.1.3 A C++ Tree Interface . . . . . . . . . . . . . . . . . . . 273
7.1.4 A Linked Structure for General Trees . . . . . . . . . . . 274
7.2 Tree Traversal Algorithms . . . . . . . . . . . . . . . . . . . 275
7.2.1 Depth and Height . . . . . . . . . . . . . . . . . . . . . 275
7.2.2 Preorder Traversal . . . . . . . . . . . . . . . . . . . . . 278
7.2.3 Postorder Traversal . . . . . . . . . . . . . . . . . . . . 281
7.3 Binary Trees . . . . . . . . . . . . . . . . . . . . . . . . . . . 284
7.3.1 The Binary Tree ADT . . . . . . . . . . . . . . . . . . . 285
7.3.2 A C++ Binary Tree Interface . . . . . . . . . . . . . . . 286
7.3.3 Properties of Binary Trees . . . . . . . . . . . . . . . . 287
7.3.4 A Linked Structure for Binary Trees . . . . . . . . . . . 289
7.3.5 A Vector-Based Structure for Binary Trees . . . . . . . . 295
7.3.6 Traversals of a Binary Tree . . . . . . . . . . . . . . . . 297
7.3.7 The Template Function Pattern . . . . . . . . . . . . . 303
7.3.8 Representing General Trees with Binary Trees . . . . . . 309
7.4 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 310
Contents xix
8 Heaps and Priority Queues 321
8.1 The Priority Queue Abstract Data Type . . . . . . . . . . . 322
8.1.1 Keys, Priorities, and Total Order Relations . . . . . . . . 322
8.1.2 Comparators . . . . . . . . . . . . . . . . . . . . . . . . 324
8.1.3 The Priority Queue ADT . . . . . . . . . . . . . . . . . 327
8.1.4 A C++ Priority Queue Interface . . . . . . . . . . . . . . 328
8.1.5 Sorting with a Priority Queue . . . . . . . . . . . . . . . 329
8.1.6 The STL priority queue Class . . . . . . . . . . . . . . . 330
8.2 Implementing a Priority Queue with a List . . . . . . . . . . 331
8.2.1 A C++ Priority Queue Implementation using a List . . . 333
8.2.2 Selection-Sort and Insertion-Sort . . . . . . . . . . . . . 335
8.3 Heaps . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 337
8.3.1 The Heap Data Structure . . . . . . . . . . . . . . . . . 337
8.3.2 Complete Binary Trees and Their Representation . . . . 340
8.3.3 Implementing a Priority Queue with a Heap . . . . . . . 344
8.3.4 C++ Implementation . . . . . . . . . . . . . . . . . . . 349
8.3.5 Heap-Sort . . . . . . . . . . . . . . . . . . . . . . . . . 351
8.3.6 Bottom-Up Heap Construction ⋆ . . . . . . . . . . . . . 353
8.4 Adaptable Priority Queues . . . . . . . . . . . . . . . . . . . 357
8.4.1 A List-Based Implementation . . . . . . . . . . . . . . . 358
8.4.2 Location-Aware Entries . . . . . . . . . . . . . . . . . . 360
8.5 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 361
9 Hash Tables, Maps, and Skip Lists 367
9.1 Maps . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 368
9.1.1 The Map ADT . . . . . . . . . . . . . . . . . . . . . . 369
9.1.2 A C++ Map Interface . . . . . . . . . . . . . . . . . . . 371
9.1.3 The STL map Class . . . . . . . . . . . . . . . . . . . . 372
9.1.4 A Simple List-Based Map Implementation . . . . . . . . 374
9.2 Hash Tables . . . . . . . . . . . . . . . . . . . . . . . . . . . 375
9.2.1 Bucket Arrays . . . . . . . . . . . . . . . . . . . . . . . 375
9.2.2 Hash Functions . . . . . . . . . . . . . . . . . . . . . . 376
9.2.3 Hash Codes . . . . . . . . . . . . . . . . . . . . . . . . 376
9.2.4 Compression Functions . . . . . . . . . . . . . . . . . . 380
9.2.5 Collision-Handling Schemes . . . . . . . . . . . . . . . . 382
9.2.6 Load Factors and Rehashing . . . . . . . . . . . . . . . 386
9.2.7 A C++ Hash Table Implementation . . . . . . . . . . . . 387
9.3 Ordered Maps . . . . . . . . . . . . . . . . . . . . . . . . . . 394
9.3.1 Ordered Search Tables and Binary Search . . . . . . . . 395
9.3.2 Two Applications of Ordered Maps . . . . . . . . . . . . 399
9.4 Skip Lists . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 402
xx Contents
9.4.1 Search and Update Operations in a Skip List . . . . . . 404
9.4.2 A Probabilistic Analysis of Skip Lists ⋆ . . . . . . . . . 408
9.5 Dictionaries . . . . . . . . . . . . . . . . . . . . . . . . . . . . 411
9.5.1 The Dictionary ADT . . . . . . . . . . . . . . . . . . . 411
9.5.2 A C++ Dictionary Implementation . . . . . . . . . . . . 413
9.5.3 Implementations with Location-Aware Entries . . . . . . 415
9.6 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 417
10 Search Trees 423
10.1 Binary Search Trees . . . . . . . . . . . . . . . . . . . . . . . 424
10.1.1 Searching . . . . . . . . . . . . . . . . . . . . . . . . . 426
10.1.2 Update Operations . . . . . . . . . . . . . . . . . . . . 428
10.1.3 C++ Implementation of a Binary Search Tree . . . . . . 432
10.2 AVL Trees . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 438
10.2.1 Update Operations . . . . . . . . . . . . . . . . . . . . 440
10.2.2 C++ Implementation of an AVL Tree . . . . . . . . . . . 446
10.3 Splay Trees . . . . . . . . . . . . . . . . . . . . . . . . . . . . 450
10.3.1 Splaying . . . . . . . . . . . . . . . . . . . . . . . . . . 450
10.3.2 When to Splay . . . . . . . . . . . . . . . . . . . . . . . 454
10.3.3 Amortized Analysis of Splaying ⋆ . . . . . . . . . . . . 456
10.4 (2,4) Trees . . . . . . . . . . . . . . . . . . . . . . . . . . . . 461
10.4.1 Multi-Way Search Trees . . . . . . . . . . . . . . . . . . 461
10.4.2 Update Operations for (2,4) Trees . . . . . . . . . . . . 467
10.5 Red-Black Trees . . . . . . . . . . . . . . . . . . . . . . . . . 473
10.5.1 Update Operations . . . . . . . . . . . . . . . . . . . . 475
10.5.2 C++ Implementation of a Red-Black Tree . . . . . . . . 488
10.6 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 492
11 Sorting, Sets, and Selection 499
11.1 Merge-Sort . . . . . . . . . . . . . . . . . . . . . . . . . . . . 500
11.1.1 Divide-and-Conquer . . . . . . . . . . . . . . . . . . . . 500
11.1.2 Merging Arrays and Lists . . . . . . . . . . . . . . . . . 505
11.1.3 The Running Time of Merge-Sort . . . . . . . . . . . . 508
11.1.4 C++ Implementations of Merge-Sort . . . . . . . . . . . 509
11.1.5 Merge-Sort and Recurrence Equations ⋆ . . . . . . . . . 511
11.2 Quick-Sort . . . . . . . . . . . . . . . . . . . . . . . . . . . . 513
11.2.1 Randomized Quick-Sort . . . . . . . . . . . . . . . . . . 521
11.2.2 C++ Implementations and Optimizations . . . . . . . . . 523
11.3 Studying Sorting through an Algorithmic Lens . . . . . . . 526
11.3.1 A Lower Bound for Sorting . . . . . . . . . . . . . . . . 526
11.3.2 Linear-Time Sorting: Bucket-Sort and Radix-Sort . . . . 528
11.3.3 Comparing Sorting Algorithms . . . . . . . . . . . . . . 531
Contents xxi
11.4 Sets and Union/Find Structures . . . . . . . . . . . . . . . . 533
11.4.1 The Set ADT . . . . . . . . . . . . . . . . . . . . . . . 533
11.4.2 Mergable Sets and the Template Method Pattern . . . . 534
11.4.3 Partitions with Union-Find Operations . . . . . . . . . . 538
11.5 Selection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 542
11.5.1 Prune-and-Search . . . . . . . . . . . . . . . . . . . . . 542
11.5.2 Randomized Quick-Select . . . . . . . . . . . . . . . . . 543
11.5.3 Analyzing Randomized Quick-Select . . . . . . . . . . . 544
11.6 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 545
12 Strings and Dynamic Programming 553
12.1 String Operations . . . . . . . . . . . . . . . . . . . . . . . . 554
12.1.1 The STL String Class . . . . . . . . . . . . . . . . . . . 555
12.2 Dynamic Programming . . . . . . . . . . . . . . . . . . . . . 557
12.2.1 Matrix Chain-Product . . . . . . . . . . . . . . . . . . . 557
12.2.2 DNA and Text Sequence Alignment . . . . . . . . . . . 560
12.3 Pattern Matching Algorithms . . . . . . . . . . . . . . . . . 564
12.3.1 Brute Force . . . . . . . . . . . . . . . . . . . . . . . . 564
12.3.2 The Boyer-Moore Algorithm . . . . . . . . . . . . . . . 566
12.3.3 The Knuth-Morris-Pratt Algorithm . . . . . . . . . . . . 570
12.4 Text Compression and the Greedy Method . . . . . . . . . 575
12.4.1 The Huffman-Coding Algorithm . . . . . . . . . . . . . 576
12.4.2 The Greedy Method . . . . . . . . . . . . . . . . . . . . 577
12.5 Tries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 578
12.5.1 Standard Tries . . . . . . . . . . . . . . . . . . . . . . . 578
12.5.2 Compressed Tries . . . . . . . . . . . . . . . . . . . . . 582
12.5.3 Suffix Tries . . . . . . . . . . . . . . . . . . . . . . . . 584
12.5.4 Search Engines . . . . . . . . . . . . . . . . . . . . . . 586
12.6 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 587
13 Graph Algorithms 593
13.1 Graphs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 594
13.1.1 The Graph ADT . . . . . . . . . . . . . . . . . . . . . . 599
13.2 Data Structures for Graphs . . . . . . . . . . . . . . . . . . . 600
13.2.1 The Edge List Structure . . . . . . . . . . . . . . . . . . 600
13.2.2 The Adjacency List Structure . . . . . . . . . . . . . . . 603
13.2.3 The Adjacency Matrix Structure . . . . . . . . . . . . . 605
13.3 Graph Traversals . . . . . . . . . . . . . . . . . . . . . . . . . 607
13.3.1 Depth-First Search . . . . . . . . . . . . . . . . . . . . 607
13.3.2 Implementing Depth-First Search . . . . . . . . . . . . . 611
13.3.3 A Generic DFS Implementation in C++ . . . . . . . . . . 613
13.3.4 Polymorphic Objects and Decorator Values ⋆ . . . . . . 621
xxii Contents
13.3.5 Breadth-First Search . . . . . . . . . . . . . . . . . . . 623
13.4 Directed Graphs . . . . . . . . . . . . . . . . . . . . . . . . . 626
13.4.1 Traversing a Digraph . . . . . . . . . . . . . . . . . . . 628
13.4.2 Transitive Closure . . . . . . . . . . . . . . . . . . . . . 630
13.4.3 Directed Acyclic Graphs . . . . . . . . . . . . . . . . . . 633
13.5 Shortest Paths . . . . . . . . . . . . . . . . . . . . . . . . . . 637
13.5.1 Weighted Graphs . . . . . . . . . . . . . . . . . . . . . 637
13.5.2 Dijkstra’s Algorithm . . . . . . . . . . . . . . . . . . . . 639
13.6 Minimum Spanning Trees . . . . . . . . . . . . . . . . . . . . 645
13.6.1 Kruskal’s Algorithm . . . . . . . . . . . . . . . . . . . . 647
13.6.2 The Prim-Jarn´ık Algorithm . . . . . . . . . . . . . . . . 651
13.7 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 654
14 Memory Management and B-Trees 665
14.1 Memory Management . . . . . . . . . . . . . . . . . . . . . . 666
14.1.1 Memory Allocation in C++ . . . . . . . . . . . . . . . . 669
14.1.2 Garbage Collection . . . . . . . . . . . . . . . . . . . . 671
14.2 External Memory and Caching . . . . . . . . . . . . . . . . . 673
14.2.1 The Memory Hierarchy . . . . . . . . . . . . . . . . . . 673
14.2.2 Caching Strategies . . . . . . . . . . . . . . . . . . . . 674
14.3 External Searching and B-Trees . . . . . . . . . . . . . . . . 679
14.3.1 (a,b) Trees . . . . . . . . . . . . . . . . . . . . . . . . 680
14.3.2 B-Trees . . . . . . . . . . . . . . . . . . . . . . . . . . 682
14.4 External-Memory Sorting . . . . . . . . . . . . . . . . . . . . 683
14.4.1 Multi-Way Merging . . . . . . . . . . . . . . . . . . . . 684
14.5 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 685
Other documents randomly have
different content
altri altre cose infinite su questo andare.„ E se Porfirio pensa di
uccidersi, non trova forse antichi esempi di uomini che vollero morire
“per tedio solamente, e per sazietà dello stato proprio.... quali erano
coloro che udito Egesia, filosofo cirenaico, recitare quelle sue lezioni
sulla miseria della vita; uscendo dalla scuola andavano e si
uccidevano; onde esso Egesia fu detto per soprannome il persuasor
di morire?...„
Certamente gli antichi lodarono anche moltissimo la vita; come la
lodano anche i moderni: ad ora ad ora il pianto cessa, gli occhi
brillano, i canti di gioia riecheggiano; ma che cosa concludere? Che
vi sono due leggi, una del dolore, un'altra del piacere? Le leggi
particolari sono molte; ma dev'essercene pure una generale,
universale, la legge delle leggi, la chiave del mistero. L'appetito di
scienza che è in Leopardi filosofo non resta appagato se dalle leggi
particolari egli non assorge all'ultima, o alla prima, all'unica
certamente dalla quale tutte le altre dipendono. Ma questa verità
fondamentale nessun uomo l'ha scoperta, nessun uomo la può
scoprire; guardate: se uno s'affanna troppo a cercarla, la scienza
moderna lo chiama pazzo, lo giudica affetto da follia metafisica!...
Tale è veramente la condizione dell'intelletto umano: che esso, o
deve rinunziare a comprendere tutta quanta la verità, o deve
appagarsi di una verità non tutta vera. Il Leopardi passa dalla
considerazione del proprio dolore a quello degli altri uomini, dei vivi
e dei morti; logicamente collega tutti i fatti che lo dimostrano; da
filosofo segue “indefessamente con l'occhio dell'intelletto un ordine
di verità connesse tra loro a mano a mano„, ed arriva alla legge del
dolore universale, necessario, eterno, infinito, inconsolabile. Ma egli
pur sente d'avere esagerato. La sua teoria non è equa, come non
sono state eque tutte le altre d'invenzione umana; ed egli stesso
implicitamente lo riconosce. Filippo Ottonieri “stimava che una buona
parte degli uomini, antichi e moderni, che sono riputati grandi o
straordinari, conseguirono questa riputazione in virtù principalmente
dell'eccesso di qualche loro qualità sopra le altre. E che uno in cui le
qualità dello spirito sieno bilanciate e proporzionate fra loro; se bene
elle fossero o straordinarie o grandi oltre modo, possa con difficoltà
far cose degne dell'uno o dell'altro titolo, ed apparire ai presenti o ai
futuri nè grande nè straordinario.„ Un uomo veramente, esattamente
equilibrato, che volesse e sapesse tenere conto preciso di tutto, non
solo non farebbe cose grandi o straordinarie, ma non ne farebbe
neppur piccole, non farebbe niente. Tutti i nostri giudizii sono
parziali, partigiani, appassionati, monchi; ma chi si spaventasse di
questa necessità dovrebbe continuamente tacere. Poichè il silenzio
continuo e la rinunzia totale sono impossibili in qualunque uomo, e
più che impossibili, assurdi in un ingegno, in un genio come Giacomo
Leopardi, questi formulerà postulati dei quali, mentre l'amor proprio
vuole che si riconosca l'esattezza, la ragione denunzia
inconsapevolmente l'esagerazione, perciò la falsità. Tutte le volte —
e come vedemmo non sono poche — che egli riconosce il nesso tra
la sua vita e la sua filosofia, non viene a dire, indirettamente, che la
sua filosofia sarebbe diversa se egli avesse avuto un altro destino? E
questo nesso che c'è in lui, non c'è in ogni uomo? Quindi tutte le
filosofie non sono relative e, per qualche lato, false? Egli che ha fatto
tante distinzioni tra uomini ed uomini e che si è tanto lagnato del
proprio destino, afferma pure “questa massima riconosciuta da tutti i
filosofi, la quale ti potrà consolare in molte occorrenze; ed è che la
felicità e l'infelicità di ciascun uomo (esclusi i dolori del corpo) è
assolutamente eguale a quella di ciascun altro, in qualunque
condizione o situazione si trovi questo o quello. E perciò,
esattamente parlando, tanto gode e tanto pena il povero, il vecchio,
il debole, il brutto, l'ignorante, quanto il ricco, il giovane, il forte, il
bello, il dotto: perchè ciascuno nel suo stato si fabbrica i suoi beni e i
suoi mali; e la somma dei beni e dei mali che ciascun uomo si può
fabbricare è uguale a quella che si fabbrica qualunque altro.„ Ma,
come abbiamo visto che lo Chateaubriand non mette nelle sue opere
la sentenza disperatissima sulla necessità della morte totale senza
speranza di vita futura, così il Leopardi non sviluppa nei suoi scritti il
più equo e consolante giudizio: lo esprime soltanto in una lettera alla
sorella. Una critica meschina ed arrogante ardisce cogliere in fallo
queste grandi anime, e presume di veder meglio di loro e più a
dentro. Esse vedono e sanno tutto; ma naturalmente tutti i concetti
non sono e non possono essere concordi; e fra i moltissimi bisogna
pure scegliere. Il Leopardi ha visto prima che i suoi censori quel che
si può e si deve dire contro la sua filosofia disperata; leggete il suo
epistolario: vedrete che egli vi appare meno pessimista che non nelle
opere. Certo l'esagerazione è biasimevole; ma non è altrettanto
necessaria? Ecco: per il suo bisogno di risolvere i formidabili enimmi
della vita e della morte lo hanno giudicato infermo di follia
metafisica; se egli avesse temperato il suo pessimismo, se avesse
dato forza agli argomenti con i quali sente di poterlo combattere,
avrebbero provato che in lui c'è anche la follia del dubbio.
Per fortuna questa accusa almeno non gli può esser mossa. Non
ostante le contraddizioni inevitabili, egli non dubita. È un
appassionato, un operoso ridotto contro sua voglia a discutere, ma
inconsolabile per essersi dovuto restringere ai semplici ragionamenti;
tutta la forza della sua volontà è concentrata nella sua fede —
negativa, ma incrollabile. Nel negare, egli mette lo slancio mistico dei
suoi pii antenati. Non che dubitare della sua credenza al rovescio,
egli l'afferma vivacemente, e sdegnosamente protesta contro chi ne
vuol scemare il valore, riducendola a un effetto dei suoi dolori. E non
ha torto: la sua filosofia, se è derivata dall'esperienza, è anche
scaturita dalla ragione. Ma un pessimismo soltanto filosofico e
speculativo interesserebbe i pensatori, lasciando freddi tutti gli altri.
Il pessimismo del Leopardi non è freddo, perchè il filosofo è
accompagnato in lui dal poeta; e non è falso, perchè la speculazione
è accompagnata dall'esperienza. Il filosofo che nega è anche un
uomo che soffre. Perciò egli fu, è e sarà sempre creduto.
Egli fu, è e sarà sempre ammirato perchè ha saputo definire tutti gli
aspetti del dolore umano con una forma che eccita il più grande, il
più puro, il più raro piacere. — Questo pessimismo suo, quantunque
sembri totale e insanabile, ammette un temperamento ed offre un
conforto. Egli preferisce la morte alla vita; ma la morte non consola
la vita, la distrugge: la consolazione è nell'Arte. Per quella stessa
ragione che la gioventù e l'amore sono le sole cose delle quali egli si
loderebbe, l'arte è la sua consolazione. Amore e gioventù vivono di
amene illusioni, che la vita pur troppo distrugge: l'arte crea tutto un
mondo ideale contro il quale la realtà non può nulla: in mezzo alle
peggiori disgrazie, tra i disinganni più atroci, l'artista può rifugiarvisi.
Ed egli vi si rifugia. La sua gioventù è finita prima di cominciare;
nessuna donna lo ha amato; i mali lo assediano; ma il suo pensiero
vive ed opera ad ora ad ora, e l'arte gli concede tutte le sue grazie.
Essa è per lui divina. Giudicata “inevitabile„ l'umana infelicità, egli
trova un conforto negli “studi del bello.„ Se la vita degli uomini è
tutto un ozio perchè tutto è vanità, l'arte, che pare esercitarsi intorno
a cose vane, è invece la sola attività utile, perchè essa sola
compensa la tristezza della realtà con la letizia delle fantasie. Questo
è un invertimento del giudizio comune: che importa, se l'infelice
ottiene per esso un sollievo e si riconcilia con la vita e quasi
benedice quella natura che aveva già maledetta?

Fine.
INDICE

Parte Prima.
L'UOMO.

L'indole: I. Il sentimento poetico Pag. 1


II. Lo spirito filosofico 11

L'educazione: Classicismo e
romanticismo 23

L'esperienza: I. La salute 52
II. L'amore 65
III. La famiglia 94
IV. La patria 152
V. La gloria 177

Parte Seconda.
IL PENSIERO.

Il pessimismo: I. L'illusione 193


II. La misantropia 212
III. Lo scetticismo 224
IV. La morte 237

L'ironia 245

Epilogo 278
OPERE DI FEDERICO DE ROBERTO

(Edizioni Treves).

Le donne, i cavalier'.... Edizione di lusso, in-8,


illustrata da 100 incisioni L. 12 —
I Vicerè, romanzo. 2 vol. 10 —
Una pagina della storia dell'amore 3 50
L'illusione, romanzo 3 50
La sorte, novelle 3 50
La messa di nozze, romanzo 5—
L'albero della scienza, novelle 4—
Al rombo del cannone 5—
All'ombra dell'olivo 6—
Ironie, novelle 4—
Leopardi 7—
Nota del Trascrittore

Ortografia e punteggiatura originali sono state


mantenute, correggendo senza annotazione minimi errori
tipografici.
*** END OF THE PROJECT GUTENBERG EBOOK LEOPARDI ***

Updated editions will replace the previous one—the old editions


will be renamed.

Creating the works from print editions not protected by U.S.


copyright law means that no one owns a United States
copyright in these works, so the Foundation (and you!) can copy
and distribute it in the United States without permission and
without paying copyright royalties. Special rules, set forth in the
General Terms of Use part of this license, apply to copying and
distributing Project Gutenberg™ electronic works to protect the
PROJECT GUTENBERG™ concept and trademark. Project
Gutenberg is a registered trademark, and may not be used if
you charge for an eBook, except by following the terms of the
trademark license, including paying royalties for use of the
Project Gutenberg trademark. If you do not charge anything for
copies of this eBook, complying with the trademark license is
very easy. You may use this eBook for nearly any purpose such
as creation of derivative works, reports, performances and
research. Project Gutenberg eBooks may be modified and
printed and given away—you may do practically ANYTHING in
the United States with eBooks not protected by U.S. copyright
law. Redistribution is subject to the trademark license, especially
commercial redistribution.

START: FULL LICENSE


THE FULL PROJECT GUTENBERG LICENSE
PLEASE READ THIS BEFORE YOU DISTRIBUTE OR USE THIS WORK

To protect the Project Gutenberg™ mission of promoting the


free distribution of electronic works, by using or distributing this
work (or any other work associated in any way with the phrase
“Project Gutenberg”), you agree to comply with all the terms of
the Full Project Gutenberg™ License available with this file or
online at www.gutenberg.org/license.

Section 1. General Terms of Use and


Redistributing Project Gutenberg™
electronic works
1.A. By reading or using any part of this Project Gutenberg™
electronic work, you indicate that you have read, understand,
agree to and accept all the terms of this license and intellectual
property (trademark/copyright) agreement. If you do not agree
to abide by all the terms of this agreement, you must cease
using and return or destroy all copies of Project Gutenberg™
electronic works in your possession. If you paid a fee for
obtaining a copy of or access to a Project Gutenberg™
electronic work and you do not agree to be bound by the terms
of this agreement, you may obtain a refund from the person or
entity to whom you paid the fee as set forth in paragraph 1.E.8.

1.B. “Project Gutenberg” is a registered trademark. It may only


be used on or associated in any way with an electronic work by
people who agree to be bound by the terms of this agreement.
There are a few things that you can do with most Project
Gutenberg™ electronic works even without complying with the
full terms of this agreement. See paragraph 1.C below. There
are a lot of things you can do with Project Gutenberg™
electronic works if you follow the terms of this agreement and
help preserve free future access to Project Gutenberg™
electronic works. See paragraph 1.E below.
1.C. The Project Gutenberg Literary Archive Foundation (“the
Foundation” or PGLAF), owns a compilation copyright in the
collection of Project Gutenberg™ electronic works. Nearly all the
individual works in the collection are in the public domain in the
United States. If an individual work is unprotected by copyright
law in the United States and you are located in the United
States, we do not claim a right to prevent you from copying,
distributing, performing, displaying or creating derivative works
based on the work as long as all references to Project
Gutenberg are removed. Of course, we hope that you will
support the Project Gutenberg™ mission of promoting free
access to electronic works by freely sharing Project Gutenberg™
works in compliance with the terms of this agreement for
keeping the Project Gutenberg™ name associated with the
work. You can easily comply with the terms of this agreement
by keeping this work in the same format with its attached full
Project Gutenberg™ License when you share it without charge
with others.

1.D. The copyright laws of the place where you are located also
govern what you can do with this work. Copyright laws in most
countries are in a constant state of change. If you are outside
the United States, check the laws of your country in addition to
the terms of this agreement before downloading, copying,
displaying, performing, distributing or creating derivative works
based on this work or any other Project Gutenberg™ work. The
Foundation makes no representations concerning the copyright
status of any work in any country other than the United States.

1.E. Unless you have removed all references to Project


Gutenberg:

1.E.1. The following sentence, with active links to, or other


immediate access to, the full Project Gutenberg™ License must
appear prominently whenever any copy of a Project
Gutenberg™ work (any work on which the phrase “Project
Gutenberg” appears, or with which the phrase “Project
Gutenberg” is associated) is accessed, displayed, performed,
viewed, copied or distributed:

This eBook is for the use of anyone anywhere in the United


States and most other parts of the world at no cost and
with almost no restrictions whatsoever. You may copy it,
give it away or re-use it under the terms of the Project
Gutenberg License included with this eBook or online at
www.gutenberg.org. If you are not located in the United
States, you will have to check the laws of the country
where you are located before using this eBook.

1.E.2. If an individual Project Gutenberg™ electronic work is


derived from texts not protected by U.S. copyright law (does not
contain a notice indicating that it is posted with permission of
the copyright holder), the work can be copied and distributed to
anyone in the United States without paying any fees or charges.
If you are redistributing or providing access to a work with the
phrase “Project Gutenberg” associated with or appearing on the
work, you must comply either with the requirements of
paragraphs 1.E.1 through 1.E.7 or obtain permission for the use
of the work and the Project Gutenberg™ trademark as set forth
in paragraphs 1.E.8 or 1.E.9.

1.E.3. If an individual Project Gutenberg™ electronic work is


posted with the permission of the copyright holder, your use and
distribution must comply with both paragraphs 1.E.1 through
1.E.7 and any additional terms imposed by the copyright holder.
Additional terms will be linked to the Project Gutenberg™
License for all works posted with the permission of the copyright
holder found at the beginning of this work.

1.E.4. Do not unlink or detach or remove the full Project


Gutenberg™ License terms from this work, or any files
containing a part of this work or any other work associated with
Project Gutenberg™.

1.E.5. Do not copy, display, perform, distribute or redistribute


this electronic work, or any part of this electronic work, without
prominently displaying the sentence set forth in paragraph 1.E.1
with active links or immediate access to the full terms of the
Project Gutenberg™ License.

1.E.6. You may convert to and distribute this work in any binary,
compressed, marked up, nonproprietary or proprietary form,
including any word processing or hypertext form. However, if
you provide access to or distribute copies of a Project
Gutenberg™ work in a format other than “Plain Vanilla ASCII” or
other format used in the official version posted on the official
Project Gutenberg™ website (www.gutenberg.org), you must,
at no additional cost, fee or expense to the user, provide a copy,
a means of exporting a copy, or a means of obtaining a copy
upon request, of the work in its original “Plain Vanilla ASCII” or
other form. Any alternate format must include the full Project
Gutenberg™ License as specified in paragraph 1.E.1.

1.E.7. Do not charge a fee for access to, viewing, displaying,


performing, copying or distributing any Project Gutenberg™
works unless you comply with paragraph 1.E.8 or 1.E.9.

1.E.8. You may charge a reasonable fee for copies of or


providing access to or distributing Project Gutenberg™
electronic works provided that:

• You pay a royalty fee of 20% of the gross profits you derive
from the use of Project Gutenberg™ works calculated using the
method you already use to calculate your applicable taxes. The
fee is owed to the owner of the Project Gutenberg™ trademark,
but he has agreed to donate royalties under this paragraph to
the Project Gutenberg Literary Archive Foundation. Royalty
payments must be paid within 60 days following each date on
which you prepare (or are legally required to prepare) your
periodic tax returns. Royalty payments should be clearly marked
as such and sent to the Project Gutenberg Literary Archive
Foundation at the address specified in Section 4, “Information
about donations to the Project Gutenberg Literary Archive
Foundation.”

• You provide a full refund of any money paid by a user who


notifies you in writing (or by e-mail) within 30 days of receipt
that s/he does not agree to the terms of the full Project
Gutenberg™ License. You must require such a user to return or
destroy all copies of the works possessed in a physical medium
and discontinue all use of and all access to other copies of
Project Gutenberg™ works.

• You provide, in accordance with paragraph 1.F.3, a full refund of


any money paid for a work or a replacement copy, if a defect in
the electronic work is discovered and reported to you within 90
days of receipt of the work.

• You comply with all other terms of this agreement for free
distribution of Project Gutenberg™ works.

1.E.9. If you wish to charge a fee or distribute a Project


Gutenberg™ electronic work or group of works on different
terms than are set forth in this agreement, you must obtain
permission in writing from the Project Gutenberg Literary
Archive Foundation, the manager of the Project Gutenberg™
trademark. Contact the Foundation as set forth in Section 3
below.

1.F.

1.F.1. Project Gutenberg volunteers and employees expend


considerable effort to identify, do copyright research on,
transcribe and proofread works not protected by U.S. copyright
law in creating the Project Gutenberg™ collection. Despite these
efforts, Project Gutenberg™ electronic works, and the medium
on which they may be stored, may contain “Defects,” such as,
but not limited to, incomplete, inaccurate or corrupt data,
transcription errors, a copyright or other intellectual property
infringement, a defective or damaged disk or other medium, a
computer virus, or computer codes that damage or cannot be
read by your equipment.

1.F.2. LIMITED WARRANTY, DISCLAIMER OF DAMAGES - Except


for the “Right of Replacement or Refund” described in
paragraph 1.F.3, the Project Gutenberg Literary Archive
Foundation, the owner of the Project Gutenberg™ trademark,
and any other party distributing a Project Gutenberg™ electronic
work under this agreement, disclaim all liability to you for
damages, costs and expenses, including legal fees. YOU AGREE
THAT YOU HAVE NO REMEDIES FOR NEGLIGENCE, STRICT
LIABILITY, BREACH OF WARRANTY OR BREACH OF CONTRACT
EXCEPT THOSE PROVIDED IN PARAGRAPH 1.F.3. YOU AGREE
THAT THE FOUNDATION, THE TRADEMARK OWNER, AND ANY
DISTRIBUTOR UNDER THIS AGREEMENT WILL NOT BE LIABLE
TO YOU FOR ACTUAL, DIRECT, INDIRECT, CONSEQUENTIAL,
PUNITIVE OR INCIDENTAL DAMAGES EVEN IF YOU GIVE
NOTICE OF THE POSSIBILITY OF SUCH DAMAGE.

1.F.3. LIMITED RIGHT OF REPLACEMENT OR REFUND - If you


discover a defect in this electronic work within 90 days of
receiving it, you can receive a refund of the money (if any) you
paid for it by sending a written explanation to the person you
received the work from. If you received the work on a physical
medium, you must return the medium with your written
explanation. The person or entity that provided you with the
defective work may elect to provide a replacement copy in lieu
of a refund. If you received the work electronically, the person
or entity providing it to you may choose to give you a second
opportunity to receive the work electronically in lieu of a refund.
If the second copy is also defective, you may demand a refund
in writing without further opportunities to fix the problem.

1.F.4. Except for the limited right of replacement or refund set


forth in paragraph 1.F.3, this work is provided to you ‘AS-IS’,
WITH NO OTHER WARRANTIES OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO WARRANTIES OF
MERCHANTABILITY OR FITNESS FOR ANY PURPOSE.

1.F.5. Some states do not allow disclaimers of certain implied


warranties or the exclusion or limitation of certain types of
damages. If any disclaimer or limitation set forth in this
agreement violates the law of the state applicable to this
agreement, the agreement shall be interpreted to make the
maximum disclaimer or limitation permitted by the applicable
state law. The invalidity or unenforceability of any provision of
this agreement shall not void the remaining provisions.

1.F.6. INDEMNITY - You agree to indemnify and hold the


Foundation, the trademark owner, any agent or employee of the
Foundation, anyone providing copies of Project Gutenberg™
electronic works in accordance with this agreement, and any
volunteers associated with the production, promotion and
distribution of Project Gutenberg™ electronic works, harmless
from all liability, costs and expenses, including legal fees, that
arise directly or indirectly from any of the following which you
do or cause to occur: (a) distribution of this or any Project
Gutenberg™ work, (b) alteration, modification, or additions or
deletions to any Project Gutenberg™ work, and (c) any Defect
you cause.

Section 2. Information about the Mission


of Project Gutenberg™
Project Gutenberg™ is synonymous with the free distribution of
electronic works in formats readable by the widest variety of
computers including obsolete, old, middle-aged and new
computers. It exists because of the efforts of hundreds of
volunteers and donations from people in all walks of life.

Volunteers and financial support to provide volunteers with the


assistance they need are critical to reaching Project
Gutenberg™’s goals and ensuring that the Project Gutenberg™
collection will remain freely available for generations to come. In
2001, the Project Gutenberg Literary Archive Foundation was
created to provide a secure and permanent future for Project
Gutenberg™ and future generations. To learn more about the
Project Gutenberg Literary Archive Foundation and how your
efforts and donations can help, see Sections 3 and 4 and the
Foundation information page at www.gutenberg.org.

Section 3. Information about the Project


Gutenberg Literary Archive Foundation
The Project Gutenberg Literary Archive Foundation is a non-
profit 501(c)(3) educational corporation organized under the
laws of the state of Mississippi and granted tax exempt status
by the Internal Revenue Service. The Foundation’s EIN or
federal tax identification number is 64-6221541. Contributions
to the Project Gutenberg Literary Archive Foundation are tax
deductible to the full extent permitted by U.S. federal laws and
your state’s laws.

The Foundation’s business office is located at 809 North 1500


West, Salt Lake City, UT 84116, (801) 596-1887. Email contact
links and up to date contact information can be found at the
Foundation’s website and official page at
www.gutenberg.org/contact
Section 4. Information about Donations to
the Project Gutenberg Literary Archive
Foundation
Project Gutenberg™ depends upon and cannot survive without
widespread public support and donations to carry out its mission
of increasing the number of public domain and licensed works
that can be freely distributed in machine-readable form
accessible by the widest array of equipment including outdated
equipment. Many small donations ($1 to $5,000) are particularly
important to maintaining tax exempt status with the IRS.

The Foundation is committed to complying with the laws


regulating charities and charitable donations in all 50 states of
the United States. Compliance requirements are not uniform
and it takes a considerable effort, much paperwork and many
fees to meet and keep up with these requirements. We do not
solicit donations in locations where we have not received written
confirmation of compliance. To SEND DONATIONS or determine
the status of compliance for any particular state visit
www.gutenberg.org/donate.

While we cannot and do not solicit contributions from states


where we have not met the solicitation requirements, we know
of no prohibition against accepting unsolicited donations from
donors in such states who approach us with offers to donate.

International donations are gratefully accepted, but we cannot


make any statements concerning tax treatment of donations
received from outside the United States. U.S. laws alone swamp
our small staff.

Please check the Project Gutenberg web pages for current


donation methods and addresses. Donations are accepted in a
number of other ways including checks, online payments and
credit card donations. To donate, please visit:
www.gutenberg.org/donate.

Section 5. General Information About


Project Gutenberg™ electronic works
Professor Michael S. Hart was the originator of the Project
Gutenberg™ concept of a library of electronic works that could
be freely shared with anyone. For forty years, he produced and
distributed Project Gutenberg™ eBooks with only a loose
network of volunteer support.

Project Gutenberg™ eBooks are often created from several


printed editions, all of which are confirmed as not protected by
copyright in the U.S. unless a copyright notice is included. Thus,
we do not necessarily keep eBooks in compliance with any
particular paper edition.

Most people start at our website which has the main PG search
facility: www.gutenberg.org.

This website includes information about Project Gutenberg™,


including how to make donations to the Project Gutenberg
Literary Archive Foundation, how to help produce our new
eBooks, and how to subscribe to our email newsletter to hear
about new eBooks.
back

You might also like