Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
5 views

Data Structures and Problem Solving Using Java 4th, intern. Edition Weiss pdf download

The document promotes the download of various educational ebooks and textbooks, particularly focusing on data structures and problem-solving using Java and C. It provides links to several titles and includes details about the 4th international edition of 'Data Structures and Problem Solving Using Java' by Mark Allen Weiss. The text emphasizes the importance of problem-solving techniques and the use of Java for programming education.

Uploaded by

levraibacel
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views

Data Structures and Problem Solving Using Java 4th, intern. Edition Weiss pdf download

The document promotes the download of various educational ebooks and textbooks, particularly focusing on data structures and problem-solving using Java and C. It provides links to several titles and includes details about the 4th international edition of 'Data Structures and Problem Solving Using Java' by Mark Allen Weiss. The text emphasizes the importance of problem-solving techniques and the use of Java for programming education.

Uploaded by

levraibacel
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 38

Download the full version and explore a variety of ebooks

or textbooks at https://ebookultra.com

Data Structures and Problem Solving Using Java


4th, intern. Edition Weiss

_____ Follow the link below to get your download now _____

https://ebookultra.com/download/data-structures-and-problem-
solving-using-java-4th-intern-edition-weiss/

Access ebookultra.com now to download high-quality


ebooks or textbooks
We have selected some products that you may be interested in
Click the link to download now or visit ebookultra.com
for more options!.

Data Structures And Problem Solving Using C 2nd


International Edition Edition Mark Allen Weiss

https://ebookultra.com/download/data-structures-and-problem-solving-
using-c-2nd-international-edition-edition-mark-allen-weiss/

Data Abstraction and Problem Solving with Java Walls and


Mirrors Frank M. Carrano

https://ebookultra.com/download/data-abstraction-and-problem-solving-
with-java-walls-and-mirrors-frank-m-carrano/

Data Structures and Algorithms in Java 4th Edition Michael


T. Goodrich

https://ebookultra.com/download/data-structures-and-algorithms-in-
java-4th-edition-michael-t-goodrich/

Data structures using C 1st Edition Patil

https://ebookultra.com/download/data-structures-using-c-1st-edition-
patil/
Data Structures and Algorithms in Java 6th Edition Michael
T. Goodrich

https://ebookultra.com/download/data-structures-and-algorithms-in-
java-6th-edition-michael-t-goodrich/

Artificial Intelligence Structures and Strategies for


Complex Problem Solving 6th Edition George F. Luger

https://ebookultra.com/download/artificial-intelligence-structures-
and-strategies-for-complex-problem-solving-6th-edition-george-f-luger/

Artificial Intelligence Structures and Strategies for


Complex Problem Solving 5th Edition George F. Luger

https://ebookultra.com/download/artificial-intelligence-structures-
and-strategies-for-complex-problem-solving-5th-edition-george-f-luger/

Data Abstraction Problem Solving with C 6th Edition Frank


M. Carrano

https://ebookultra.com/download/data-abstraction-problem-solving-
with-c-6th-edition-frank-m-carrano/

Growing Algorithms and Data Structures 4th Edition David


Scuse

https://ebookultra.com/download/growing-algorithms-and-data-
structures-4th-edition-david-scuse/
Data Structures and Problem Solving Using Java 4th,
intern. Edition Weiss Digital Instant Download
Author(s): Weiss, Mark A.
ISBN(s): 9781292025766, 129202576X
Edition: 4th, intern.
File Details: PDF, 5.98 MB
Year: 2014
Language: english
Data Structures and Problem Solving Using Java Weiss 4e
Data Structures and Problem Solving
ISBN 978-1-29202-576-6
Using Java
Mark A. Weiss
9 781292 025766 Fourth Edition
Data Structures and Problem Solving
Using Java
Mark A. Weiss
Fourth Edition
Pearson Education Limited
Edinburgh Gate
Harlow
Essex CM20 2JE
England and Associated Companies throughout the world

Visit us on the World Wide Web at: www.pearsoned.co.uk

© Pearson Education Limited 2014

All rights reserved. No part of this publication may be reproduced, stored in a retrieval system, or transmitted
in any form or by any means, electronic, mechanical, photocopying, recording or otherwise, without either the
prior written permission of the publisher or a licence permitting restricted copying in the United Kingdom
issued by the Copyright Licensing Agency Ltd, Saffron House, 6–10 Kirby Street, London EC1N 8TS.

All trademarks used herein are the property of their respective owners. The use of any trademark
in this text does not vest in the author or publisher any trademark ownership rights in such
trademarks, nor does the use of such trademarks imply any affiliation with or endorsement of this
book by such owners.

ISBN 10: 1-292-02576-X


ISBN 13: 978-1-292-02576-6

British Library Cataloguing-in-Publication Data


A catalogue record for this book is available from the British Library

Printed in the United States of America


P E A R S O N C U S T O M L I B R A R Y

Table of Contents

1. Primitive Java
Mark Allen Weiss 1
2. Reference Types
Mark Allen Weiss 25
3. Objects and Classes
Mark Allen Weiss 67
4. Inheritance
Mark Allen Weiss 107
5. Algorithm Analysis
Mark Allen Weiss 183
6. The Collections API
Mark Allen Weiss 225
7. Recursion
Mark Allen Weiss 289
8. Sorting Algorithms
Mark Allen Weiss 347
9. Randomization
Mark Allen Weiss 389
10. Fun and Games
Mark Allen Weiss 415
11. Stacks and Compilers
Mark Allen Weiss 437
12. Utilities
Mark Allen Weiss 467
13. Graphs and Paths
Mark Allen Weiss 501

I
14. Inner Classes and Implementation of ArrayList
Mark Allen Weiss 545
15. Stacks and Queues
Mark Allen Weiss 567
16. Linked Lists
Mark Allen Weiss 591
17. Trees
Mark Allen Weiss 623
18. Binary Search Trees
Mark Allen Weiss 659
19. Hash Tables
Mark Allen Weiss 745
20. A Priority Queue: The Binary Heap
Mark Allen Weiss 779
21. Splay Trees
Mark Allen Weiss 813
22. Merging Priority Queues
Mark Allen Weiss 841
23. The Disjoint Set Class
Mark Allen Weiss 863
Appendix: Operators
Mark Allen Weiss 897
Appendix: Graphical User Interfaces
Mark Allen Weiss 899
Appendix: Bitwise Operations
Mark Allen Weiss 929
Index 933

II
primitive java

T he primary focus of this text is problem-solving techniques that allow the


construction of sophisticated, time-efficient programs. Nearly all of the mate-
rial discussed is applicable in any programming language. Some would argue
that a broad pseudocode description of these techniques could suffice to dem-
onstrate concepts. However, we believe that working with live code is vitally
important.
There is no shortage of programming languages available. This text uses
Java, which is popular both academically and commercially.
We begin by discussing the part of the language that mirrors a 1970s pro-
gramming language such as Pascal or C. This includes primitive types, basic oper-
ations, conditional and looping constructs, and the Java equivalent of functions.
In this chapter, we will see

n Some of the basics of Java, including simple lexical elements


n The Java primitive types, including some of the operations that
primitive-typed variables can perform

From Chapter 1 of Data Structures & Problem Solving Using Java™, Fourth Edition,
Mark Allen Weiss. Copyright © 2011 by Pearson Education, Inc.
Published by Pearson Addison-Wesley. All rights reserved.

1
primitive java

n How conditional statements and loop constructs are implemented in


Java
n An introduction to the static method—the Java equivalent of the
function and procedure that is used in non-object-oriented languages

1 the general environment


How are Java application programs entered, compiled, and run? The answer,
of course, depends on the particular platform that hosts the Java compiler.
javac compiles Java source code resides in files whose names end with the .java suffix.
.java files and gen- The local compiler, javac, compiles the program and generates .class files,
erates .class files
containing which contain bytecode. Java bytecodes represent the portable intermediate
bytecode. java language that is interpreted by running the Java interpreter, java. The inter-
invokes the Java
interpreter (which is
preter is also known as the Virtual Machine.
also known as the For Java programs, input can come from one of many places:
Virtual Machine).
n The terminal, whose input is denoted as standard input
n Additional parameters in the invocation of the Virtual Machine—
command-line arguments
n A GUI component
n A file

Command-line arguments are particularly important for specifying pro-


gram options. Java provides mechanisms to read and write files. Many operat-
ing systems provide an alternative known as file redirection, in which the
operating system arranges to take input from (or send output to) a file in a
manner that is transparent to the running program. On Unix (and also from an
MS/DOS window), for instance, the command

java Program < inputfile > outputfile

automatically arranges things so that any terminal reads are redirected to


come from inputfile and terminal writes are redirected to go to outputfile.

2
primitive java

2 the first program


Let us begin by examining the simple Java program shown in Figure 1. This pro-
gram prints a short phrase to the terminal. Note the line numbers shown on the left
of the code are not part of the program. They are supplied for easy reference.
Place the program in the source file FirstProgram.java and then compile
and run it. Note that the name of the source file must match the name of the
class (shown on line 4), including case conventions. If you are using the JDK,
the commands are1

javac FirstProgram.java
java FirstProgram

2.1 comments
Java has three forms of comments. The first form, which is inherited from C,
begins with the token /* and ends with */. Here is an example:

/* This is a
two-line comment */

Comments do not nest.


The second form, which is inherited from C++, begins with the token //. Comments make
There is no ending token. Rather, the comment extends to the end of the line. code easier for
humans to read.
This is shown on lines 1 and 2 in Figure 1. Java has three
The third form begins with /** instead of /*. This form can be used to forms of comments.
provide information to the javadoc utility, which will generate documentation
from comments.

1 // First program figure 1


2 // MW, 5/1/10 A simple first program
3
4 public class FirstProgram
5 {
6 public static void main( String [ ] args )
7 {
8 System.out.println( "Is there anybody out there?" );
9 }
10 }

1. If you are using Sun’s JDK, javac and java are used directly. Otherwise, in a typical interac-
tive development environment (IDE), such as Netbeans or Eclipse these commands are
executed behind the scenes on your behalf.

3
primitive java

Comments exist to make code easier for humans to read. These humans
include other programmers who may have to modify or use your code, as well
as yourself. A well-commented program is a sign of a good programmer.

2.2 main
When the program A Java program consists of a collection of interacting classes, which contain
is run, the special methods. The Java equivalent of the function or procedure is the static
method main is
invoked. method, which is described in Section 6. When any program is run, the special
static method main is invoked. Line 6 of Figure 1 shows that the static method
main is invoked, possibly with command-line arguments. The parameter types
of main and the void return type shown are required.

2.3 terminal output


println is used to The program in Figure 1 consists of a single statement, shown on line 8.
perform output. println is the primary output mechanism in Java. Here, a constant string is
placed on the standard output stream System.out by applying a println
method. For now we mention only that the same syntax is used to perform
output for any entity, whether that entity is an integer, floating point, string, or
some other type.

3 primitive types
Java defines eight primitive types. It also allows the programmer great flexi-
bility to define new types of objects, called classes. However, primitive types
and user-defined types have important differences in Java. In this section, we
examine the primitive types and the basic operations that can be performed on
them.

3.1 the primitive types


Java’s primitive Java has eight primitive types, shown in Figure 2. The most common is the
types are integer, integer, which is specified by the keyword int. Unlike with many other lan-
floating-point, Bool-
ean, and character. guages, the range of integers is not machine-dependent. Rather, it is the same
in any Java implementation, regardless of the underlying computer architec-
ture. Java also allows entities of types byte, short, and long. These are known
The Unicode stan- as integral types. Floating-point numbers are represented by the types float
dard contains over and double. double has more significant digits, so use of it is recommended
30,000 distinct
coded characters
over use of float. The char type is used to represent single characters. A char
covering the princi- occupies 16 bits to represent the Unicode standard. The Unicode standard
pal written contains over 30,000 distinct coded characters covering the principal written
languages.

4
primitive java

figure 2
Primitive Type What It Stores Range
The eight primitive
byte 8-bit integer –128 to 127 types in Java

short 16-bit integer –32,768 to 32,767

int 32-bit integer –2,147,483,648 to 2,147,483,647

long 64-bit integer –263 to 263 – 1

float 32-bit floating-point 6 significant digits ( 10–46, 1038 )

double 64-bit floating-point 15 significant digits ( 10–324, 10308 )

char Unicode character

boolean Boolean variable false and true

languages. The low end of Unicode is identical to ASCII. The final primitive
type is boolean, which is either true or false.

3.2 constants
Integer constants can be represented in either decimal, octal, or hexadecimal nota- Integer constants
tion. Octal notation is indicated by a leading 0; hexadecimal is indicated by a lead- can be repre-
sented in either
ing 0x or 0X. The following are all equivalent ways of representing the integer 37: decimal, octal, or
37, 045, 0x25. Octal integers are not used in this text. However, we must be aware of hexadecimal
notation.
them so that we use leading 0s only when we intend to. We use hexadecimals in
only one place, and we will revisit them at that point.
A character constant is enclosed with a pair of single quotation marks, as in A string constant
'a'. Internally, this character sequence is interpreted as a small number. The output consists of a
sequence of char-
routines later interpret that small number as the corresponding character. A string acters enclosed by
constant consists of a sequence of characters enclosed within double quotation double quotes.
marks, as in "Hello". There are some special sequences, known as escape sequences,
that are used (for instance, how does one represent a single quotation mark?). In this
text we use '\n', '\\', '\'', and '\"', which mean, respectively, the newline charac- Escape sequences
ter, backslash character, single quotation mark, and double quotation mark. are used to repre-
sent certain char-
acter constants.
3.3 declaration and initialization
of primitive types
Any variable, including those of a primitive type, is declared by providing its A variable is named
name, its type, and optionally, its initial value. The name must be an identifier. by using an
identifier.
An identifier may consist of any combination of letters, digits, and the under-
score character; it may not start with a digit, however. Reserved words, such

5
primitive java

as int, are not allowed. Although it is legal to do so, you should not reuse
identifier names that are already visibly used (for example, do not use main as
the name of an entity).
Java is case- Java is case-sensitive, meaning that Age and age are different identifiers.
sensitive. This text uses the following convention for naming variables: All variables
start with a lowercase letter and new words start with an uppercase letter. An
example is the identifier minimumWage.
Here are some examples of declarations:

int num3; // Default initialization


double minimumWage = 4.50; // Standard initialization
int x = 0, num1 = 0; // Two entities are declared
int num2 = num1;

A variable should be declared near its first use. As will be shown, the
placement of a declaration determines its scope and meaning.

3.4 terminal input and output


Basic formatted terminal I/O is accomplished by nextLine and println. The
standard input stream is System.in, and the standard output stream is
System.out.
The basic mechanism for formatted I/O uses the String type. For output,
+ combines two Strings. If the second argument is not a String, a tempo-
rary String is created for it if it is a primitive type. These conversions to
String can also be defined for objects. For input, we associate a Scanner
object with System.in. Then a String or a primitive type can be read.

4 basic operators
This section describes some of the operators available in Java. These opera-
tors are used to form expressions. A constant or entity by itself is an expres-
sion, as are combinations of constants and variables with operators. An
expression followed by a semicolon is a simple statement. In Section 5, we
examine other types of statements, which introduce additional operators.

6
primitive java

4.1 assignment operators


A simple Java program that illustrates a few operators is shown in Figure 3.
The basic assignment operator is the equals sign. For example, on line 16 the
variable a is assigned the value of the variable c (which at that point is 6). Sub-
sequent changes to the value of c do not affect a. Assignment operators can be
chained, as in z=y=x=0.
Another assignment operator is the +=, whose use is illustrated on line 18 Java provides a
of the figure. The += operator adds the value on the right-hand side (of the += host of assignment
operators, includ-
operator) to the variable on the left-hand side. Thus, in the figure, c is incre- ing =, +=,
mented from its value of 6 before line 18, to a value of 14. -=, *=, and /=.
Java provides various other assignment operators, such as -=, *=, and /=,
which alter the variable on the left-hand side of the operator via subtraction,
multiplication, and division, respectively.

1 public class OperatorTest figure 3


2 { Program that
3 // Program to illustrate basic operators illustrates operators
4 // The output is as follows:
5 // 12 8 6
6 // 6 8 6
7 // 6 8 14
8 // 22 8 14
9 // 24 10 33
10
11 public static void main( String [ ] args )
12 {
13 int a = 12, b = 8, c = 6;
14
15 System.out.println( a + " " + b + " " + c );
16 a = c;
17 System.out.println( a + " " + b + " " + c );
18 c += b;
19 System.out.println( a + " " + b + " " + c );
20 a = b + c;
21 System.out.println( a + " " + b + " " + c );
22 a++;
23 ++b;
24 c = a++ + ++b;
25 System.out.println( a + " " + b + " " + c );
26 }
27 }

7
primitive java

4.2 binary arithmetic operators


Java provides sev- Line 20 in Figure 3 illustrates one of the binary arithmetic operators that are
eral binary arith- typical of all programming languages: the addition operator (+). The + opera-
metic operators,
including +, -, *, tor causes the values of b and c to be added together; b and c remain
/, and %. unchanged. The resulting value is assigned to a. Other arithmetic operators
typically used in Java are -, *, /, and %, which are used, respectively, for sub-
traction, multiplication, division, and remainder. Integer division returns only
the integral part and discards any remainder.
As is typical, addition and subtraction have the same precedence, and this
precedence is lower than the precedence of the group consisting of the multi-
plication, division, and mod operators; thus 1+2*3 evaluates to 7. All of these
operators associate from left to right (so 3-2-2 evaluates to –1). All operators
have precedence and associativity.

4.3 unary operators


Several unary oper- In addition to binary arithmetic operators, which require two operands, Java
ators are defined, provides unary operators, which require only one operand. The most familiar
including -.
of these is the unary minus, which evaluates to the negative of its operand.
Thus -x returns the negative of x.
Autoincrement and Java also provides the autoincrement operator to add 1 to a variable—
autodecrement add denoted by ++ —and the autodecrement operator to subtract 1 from a variable—
1 and subtract 1,
respectively. The denoted by --. The most benign use of this feature is shown on lines 22 and
operators for doing 23 of Figure 3. In both lines, the autoincrement operator ++ adds 1 to the
this are ++ and --.
There are two
value of the variable. In Java, however, an operator applied to an expression
forms of increment- yields an expression that has a value. Although it is guaranteed that the vari-
ing and decrement- able will be incremented before the execution of the next statement, the
ing: prefix and
postfix. question arises: What is the value of the autoincrement expression if it is
used in a larger expression?
In this case, the placement of the ++ is crucial. The semantics of ++x is
that the value of the expression is the new value of x. This is called the prefix
increment. In contrast, x++ means the value of the expression is the original
value of x. This is called the postfix increment. This feature is shown in line 24
of Figure 3. a and b are both incremented by 1, and c is obtained by adding the
original value of a to the incremented value of b.

The type conversion 4.4 type conversions


operator is used to
generate a tempo- The type conversion operator is used to generate a temporary entity of a new
rary entity of a new
type. type. Consider, for instance,

8
primitive java

double quotient;
int x = 6;
int y = 10;
quotient = x / y; // Probably wrong!

The first operation is the division, and since x and y are both integers, the result is
integer division, and we obtain 0. Integer 0 is then implicitly converted to a double
so that it can be assigned to quotient. But we had intended quotient to be assigned
0.6. The solution is to generate a temporary variable for either x or y so that the
division is performed using the rules for double. This would be done as follows:

quotient = ( double ) x / y;

Note that neither x nor y are changed. An unnamed temporary is created, and
its value is used for the division. The type conversion operator has higher pre-
cedence than division does, so x is type-converted and then the division is per-
formed (rather than the conversion coming after the division of two ints being
performed).

5 conditional statements
This section examines statements that affect the flow of control: conditional
statements and loops. As a consequence, new operators are introduced.

5.1 relational and equality operators


The basic test that we can perform on primitive types is the comparison. This
is done using the equality and inequality operators, as well as the relational
operators (less than, greater than, and so on).
In Java, the equality operators are == and !=. For example, In Java, the
equality operators
leftExpr==rightExpr are == and !=.

evaluates to true if leftExpr and rightExpr are equal; otherwise, it evaluates to


false. Similarly,

leftExpr!=rightExpr

evaluates to true if leftExpr and rightExpr are not equal and to false
otherwise.
The relational operators are <, <=, >, and >=. These have natural meanings The relational
for the built-in types. The relational operators have higher precedence than the operators are <, <=,
>, and >=.
equality operators. Both have lower precedence than the arithmetic operators

9
primitive java

but higher precedence than the assignment operators, so the use of parenthe-
ses is frequently unnecessary. All of these operators associate from left to
right, but this fact is useless: In the expression a<b<6, for example, the first <
generates a boolean and the second is illegal because < is not defined for bool-
eans. The next section describes the correct way to perform this test.

5.2 logical operators


Java provides logi- Java provides logical operators that are used to simulate the Boolean algebra
cal operators that concepts of AND, OR, and NOT. These are sometimes known as conjunction,
are used to simu-
late the Boolean disjunction, and negation, respectively, whose corresponding operators are &&,
algebra concepts of ||, and !. The test in the previous section is properly implemented as a<b &&
AND, OR, and NOT.
b<6. The precedence of conjunction and disjunction is sufficiently low that
The corresponding
operators are &&, ||, parentheses are not needed. && has higher precedence than ||, while ! is
and !. grouped with other unary operators (and is thus highest of the three). The
operands and results for the logical operators are boolean. Figure 4 shows the
result of applying the logical operators for all possible inputs.
Short-circuit evalu- One important rule is that && and || are short-circuit evaluation operations.
ation means that if Short-circuit evaluation means that if the result can be determined by examining
the result of a logi-
cal operator can be the first expression, then the second expression is not evaluated. For instance, in
determined
by examining the x != 0 && 1/x != 3
first expression,
then the second if x is 0, then the first half is false. Automatically the result of the AND must
expression is not
evaluated. be false, so the second half is not evaluated. This is a good thing because
division-by-zero would give erroneous behavior. Short-circuit evaluation
allows us to not have to worry about dividing by zero.2

figure 4
x y x && y x || y !x
Result of logical
operators false false false false true

false true false true true

true false false true false

true true true true false

2. There are (extremely) rare cases in which it is preferable to not short-circuit. In such cases,
the & and | operators with boolean arguments guarantee that both arguments are evaluated,
even if the result of the operation can be determined from the first argument.

10
Exploring the Variety of Random
Documents with Different Content
Savage, Rev. Dr. Minot J., 151.
Schooling, J. Holt, 170.
Seigniorial mind, renascence of, 27;
instances of, 28, 29, 30, 32, 37, 39, 45, 180-181.
Shareholders, increase of, 17, 18, 160-163;
subordination of, 23, 24, 163.
Shearman (Thomas G.) and Redfield (Amasa A.), quoted, 111.
Single-Taxers, 5, 6, 7.
Socialism, 5, 6, 7.
Socialists, 2, 164, 167.
Social Reform Club, pamphlet of, quoted, 118-120.
Spencer, Herbert, 88.
Steel combination, magnitude of, 13, 16, 31, 66.
Stimson, F. J., 86, 112;
quoted, 132.
“Success,” 156-160.
Suicide, increase of, 173-174.
Sullivan, J. W., 79.
Sumner, Professor William G., quoted, 122-123, 133, 135-136,
174.
Swayne, Judge Charles, 117.

T
Talbot, Bishop Ethelbert, quoted, 151.
Tenantry, 9, 19;
increase of, 21, 50-55, 186.
Thayer, Judge Amos M., 104.
Tolstoi, Lyof N., 2, 3.
Trusts, see Combinations.

V
Value of dollar, comparative, 73-74.
Vandervelde, Emile, quoted, 22.
Veblen, Thorstein, quoted, 40, 43.
Villeinage, the new, 59, 184-185, 187.

W
Wadlin, Horace G., quoted, 87-88.
Wage-earners, 58, 66-82;
number in manufactures, 71;
child, 76-82;
women, 74-76.
Wage-scale, adjustment of, 66;
comparisons of, 66-79.
Wage-system, continuance of, 185, 190.
Wallace, Judge William J., quoted, 106.
Warman, Cy, 49.
Webb, Sidney, 3.
Wells, H. G., 1, 3.
Whittelsey, Dr. Sarah S., 95.
Willoughby, William F., 94.
Wright, Colonel Carroll D., 66-67.
Wyckoff, Professor Walter A., 133;
quoted, 168.
Transcriber’s Note:
Footnotes have been relabeled consecutively through the document, and the one
footnote not associated with a table has been moved to the end of its chapter.
Punctuation has been made consistent.
Variations in spelling and hyphenation were retained as they appear in the original
publication, except that obvious typographical were corrected.
*** END OF THE PROJECT GUTENBERG EBOOK OUR BENEVOLENT
FEUDALISM ***

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.
Welcome to our website – the ideal destination for book lovers and
knowledge seekers. With a mission to inspire endlessly, we offer a
vast collection of books, ranging from classic literary works to
specialized publications, self-development books, and children's
literature. Each book is a new journey of discovery, expanding
knowledge and enriching the soul of the reade

Our website is not just a platform for buying books, but a bridge
connecting readers to the timeless values of culture and wisdom. With
an elegant, user-friendly interface and an intelligent search system,
we are committed to providing a quick and convenient shopping
experience. Additionally, our special promotions and home delivery
services ensure that you save time and fully enjoy the joy of reading.

Let us accompany you on the journey of exploring knowledge and


personal growth!

ebookultra.com

You might also like