(Ebook) Java Structures: Data Structures in Java for the Principled Programmer (2nd edition) by Duane Bailey ISBN 9780072399097, 9780071121637, 9780071261203, 0072399090, 0071121633, 0071261206pdf download
(Ebook) Java Structures: Data Structures in Java for the Principled Programmer (2nd edition) by Duane Bailey ISBN 9780072399097, 9780071121637, 9780071261203, 0072399090, 0071121633, 0071261206pdf download
https://ebooknice.com/product/biota-grow-2c-gather-2c-cook-6661374
https://ebooknice.com/product/matematik-5000-kurs-2c-larobok-23848312
https://ebooknice.com/product/sat-ii-success-math-1c-and-2c-2002-peterson-
s-sat-ii-success-1722018
https://ebooknice.com/product/master-sat-ii-math-1c-and-2c-4th-ed-arco-
master-the-sat-subject-test-math-levels-1-2-2326094
https://ebooknice.com/product/data-structures-in-java-51794716
https://ebooknice.com/product/data-structures-outside-in-with-java-7361674
https://ebooknice.com/product/data-structures-and-algorithms-in-
java-2355328
https://ebooknice.com/product/data-structures-and-algorithm-analysis-in-
java-3rd-edition-2391666
Java Structures
√
The 7 Edition
(Software release 33)
Duane A. Bailey
Williams College
September 2007
√
This 7 text copyrighted 2005-2007 by
0 Introduction 1
0.1 Read Me . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
0.2 He Can’t Say That, Can He? . . . . . . . . . . . . . . . . . . . . . 2
3 Vectors 43
3.1 The Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
3.2 Example: The Word List Revisited . . . . . . . . . . . . . . . . . . 47
3.3 Example: Word Frequency . . . . . . . . . . . . . . . . . . . . . . 48
3.4 The Implementation . . . . . . . . . . . . . . . . . . . . . . . . . 50
3.5 Extensibility: A Feature . . . . . . . . . . . . . . . . . . . . . . . . 53
3.6 Example: L-Systems . . . . . . . . . . . . . . . . . . . . . . . . . 56
3.7 Example: Vector-Based Sets . . . . . . . . . . . . . . . . . . . . . 57
3.8 Example: The Matrix Class . . . . . . . . . . . . . . . . . . . . . . 60
3.9 Conclusions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64
iv Contents
4 Generics 69
4.1 Motivation (in case we need some) . . . . . . . . . . . . . . . . . 70
4.1.1 Possible Solution: Specialization . . . . . . . . . . . . . . 71
4.2 Implementing Generic Container Classes . . . . . . . . . . . . . . 72
4.2.1 Generic Associations . . . . . . . . . . . . . . . . . . . . 72
4.2.2 Parameterizing the Vector Class . . . . . . . . . . . . . . 74
4.2.3 Restricting Parameters . . . . . . . . . . . . . . . . . . . . 79
4.3 Conclusions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80
5 Design Fundamentals 81
5.1 Asymptotic Analysis Tools . . . . . . . . . . . . . . . . . . . . . . 81
5.1.1 Time and Space Complexity . . . . . . . . . . . . . . . . . 82
5.1.2 Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . 85
5.1.3 The Trading of Time and Space . . . . . . . . . . . . . . . 91
5.1.4 Back-of-the-Envelope Estimations . . . . . . . . . . . . . . 92
5.2 Self-Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94
5.2.1 Recursion . . . . . . . . . . . . . . . . . . . . . . . . . . . 94
5.2.2 Mathematical Induction . . . . . . . . . . . . . . . . . . . 101
5.3 Properties of Design . . . . . . . . . . . . . . . . . . . . . . . . . 108
5.3.1 Symmetry . . . . . . . . . . . . . . . . . . . . . . . . . . . 108
5.3.2 Friction . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110
5.4 Conclusions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110
5.5 Laboratory: How Fast Is Java? . . . . . . . . . . . . . . . . . . . . 115
6 Sorting 119
6.1 Approaching the Problem . . . . . . . . . . . . . . . . . . . . . . 119
6.2 Selection Sort . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122
6.3 Insertion Sort . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125
6.4 Mergesort . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 127
6.5 Quicksort . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 131
6.6 Radix Sort . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 134
6.7 Sorting Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . 138
6.8 Ordering Objects Using Comparators . . . . . . . . . . . . . . . . 140
6.9 Vector-Based Sorting . . . . . . . . . . . . . . . . . . . . . . . . . 143
6.10 Conclusions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 144
6.11 Laboratory: Sorting with Comparators . . . . . . . . . . . . . . . 147
8 Iterators 161
8.1 Java’s Enumeration Interface . . . . . . . . . . . . . . . . . . . . 161
8.2 The Iterator Interface . . . . . . . . . . . . . . . . . . . . . . . . . 163
8.3 Example: Vector Iterators . . . . . . . . . . . . . . . . . . . . . . 165
8.4 Example: Rethinking Generators . . . . . . . . . . . . . . . . . . 167
8.5 Example: Filtering Iterators . . . . . . . . . . . . . . . . . . . . . 170
8.6 Conclusions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 172
8.7 Laboratory: The Two-Towers Problem . . . . . . . . . . . . . . . 175
9 Lists 179
9.1 Example: A Unique Program . . . . . . . . . . . . . . . . . . . . . 182
9.2 Example: Free Lists . . . . . . . . . . . . . . . . . . . . . . . . . . 183
9.3 Partial Implementation: Abstract Lists . . . . . . . . . . . . . . . 186
9.4 Implementation: Singly Linked Lists . . . . . . . . . . . . . . . . 188
9.5 Implementation: Doubly Linked Lists . . . . . . . . . . . . . . . . 201
9.6 Implementation: Circularly Linked Lists . . . . . . . . . . . . . . 206
9.7 Implementation: Vectors . . . . . . . . . . . . . . . . . . . . . . . 209
9.8 List Iterators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 209
9.9 Conclusions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 211
9.10 Laboratory: Lists with Dummy Nodes . . . . . . . . . . . . . . . . 215
15 Maps 369
15.1 Example Revisited: The Symbol Table . . . . . . . . . . . . . . . . 369
15.2 The Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 370
15.3 Simple Implementation: MapList . . . . . . . . . . . . . . . . . . 372
15.4 Constant Time Maps: Hash Tables . . . . . . . . . . . . . . . . . . 374
15.4.1 Open Addressing . . . . . . . . . . . . . . . . . . . . . . . 375
15.4.2 External Chaining . . . . . . . . . . . . . . . . . . . . . . 383
15.4.3 Generation of Hash Codes . . . . . . . . . . . . . . . . . . 385
15.4.4 Hash Codes for Collection Classes . . . . . . . . . . . . . . 391
15.4.5 Performance Analysis . . . . . . . . . . . . . . . . . . . . . 392
15.5 Ordered Maps and Tables . . . . . . . . . . . . . . . . . . . . . . 392
15.6 Example: Document Indexing . . . . . . . . . . . . . . . . . . . . 395
15.7 Conclusions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 398
15.8 Laboratory: The Soundex Name Lookup System . . . . . . . . . . 401
16 Graphs 403
16.1 Terminology . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 403
16.2 The Graph Interface . . . . . . . . . . . . . . . . . . . . . . . . . 404
16.3 Implementations . . . . . . . . . . . . . . . . . . . . . . . . . . . 408
16.3.1 Abstract Classes Reemphasized . . . . . . . . . . . . . . . 408
16.3.2 Adjacency Matrices . . . . . . . . . . . . . . . . . . . . . . 410
16.3.3 Adjacency Lists . . . . . . . . . . . . . . . . . . . . . . . . 416
16.4 Examples: Common Graph Algorithms . . . . . . . . . . . . . . . 422
16.4.1 Reachability . . . . . . . . . . . . . . . . . . . . . . . . . . 422
16.4.2 Topological Sorting . . . . . . . . . . . . . . . . . . . . . . 424
16.4.3 Transitive Closure . . . . . . . . . . . . . . . . . . . . . . 427
16.4.4 All Pairs Minimum Distance . . . . . . . . . . . . . . . . . 428
16.4.5 Greedy Algorithms . . . . . . . . . . . . . . . . . . . . . . 429
16.5 Conclusions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 434
16.6 Laboratory: Converting Between Units . . . . . . . . . . . . . . . 439
A Answers 441
A.1 Solutions to Self Check Problems . . . . . . . . . . . . . . . . . . 441
A.2 Solutions to Odd-Numbered Problems . . . . . . . . . . . . . . . 451
C Collections 511
C.1 Collection Class Features . . . . . . . . . . . . . . . . . . . . . . . 511
C.2 Parallel Features . . . . . . . . . . . . . . . . . . . . . . . . . . . 511
C.3 Conversion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 512
D Documentation 513
D.1 Structure Package Hierarchy . . . . . . . . . . . . . . . . . . . . . 513
D.2 Principles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 515
Index 517
for Mary,
my wife and best friend
without
the model of my mentors,
the comments of my colleagues,
the support of my students,
the friendship of my family
this book would never be
thank you!
Preface to the First Edition
“I T ’ S A WONDERFUL TIME TO BE ALIVE .” At least that’s what I’ve found myself
saying over the past couple of decades. When I first started working with com-
puters, they were resources used by a privileged (or in my case, persistent) few.
They were physically large, and logically small. They were cast from iron. The
challenge was to make these behemoths solve complex problems quickly.
Today, computers are everywhere. They are in the office and at home. They
speak to us on telephones; they zap our food in the microwave. They make
starting cars in New England a possibility. Everyone’s using them. What has
aided their introduction into society is their diminished size and cost, and in-
creased capability. The challenge is to make these behemoths solve complex
problems quickly.
Thus, while the computer and its applications have changed over time, the
challenge remains the same: How can we get the best performance out of the
current technology? The design and analysis of data structures lay the funda-
mental groundwork for a scientific understanding of what computers can do
efficiently. The motivations for data structure design work accomplished three
decades ago in assembly language at the keypunch are just as familiar to us to-
day as we practice our craft in modern languages on computers on our laps. The
focus of this material is the identification and development of relatively abstract
principles for structuring data in ways that make programs efficient in terms of
their consumption of resources, as well as efficient in terms of “programmability.”
In the past, my students have encountered this material in Pascal, Modula-2,
and, most recently, C++. None of these languages has been ideal, but each has
been met with increasing expectation. This text uses The Java Programming
Language1 —“Java”—to structure data. Java is a new and exciting language
that has received considerable public attention. At the time of this writing, for
example, Java is one of the few tools that can effectively use the Internet as a
computing resource. That particular aspect of Java is not touched on greatly
in this text. Still, Internet-driven applications in Java will need supporting data
structures. This book attempts to provide a fresh and focused approach to the
design and implementation of classic structures in a manner that meshes well
with existing Java packages. It is hoped that learning this material in Java
will improve the way working programmers craft programs, and the way future
designers craft languages.
Pedagogical Implications. This text was developed specifically for use with
CS2 in a standard Computer Science curriculum. It is succinct in its approach,
and requires, perhaps, a little more effort to read. I hope, though, that this text
becomes not a brief encounter with object-oriented data structure design, but a
touchstone for one’s programming future.
The material presented in this text follows the syllabus I have used for sev-
eral years at Williams. As students come to this course with experience using
Java, the outline of the text may be followed directly. Where students are new
to Java, a couple of weeks early in the semester will be necessary with a good
N
companion text to introduce the student to new concepts, and an introductory
NW
NE
Java language text or reference manual is recommended. For students that need
W
SE
was designed as a whole, some may wish to eliminate less important topics
and expand upon others. Students may wish to drop (or consider!) the sec-
tion on induction (Section 5.2.2). The more nontraditional topics—including,
for example, iteration and the notions of symmetry and friction—have been in-
cluded because I believe they arm programmers with important mechanisms for
implementing and analyzing problems. In many departments the subtleties of
more advanced structures—maps (Chapter 15) and graphs (Chapter 16)—may
be considered in an algorithms course. Chapter 6, a discussion of sorting, pro-
vides very important motivating examples and also begins an early investigation
of algorithms. The chapter may be dropped when better examples are at hand,
but students may find the refinements on implementing sorting interesting.
Associated with this text is a Java package of data structures that is freely
available over the Internet for noncommercial purposes. I encourage students,
educators, and budding software engineers to download it, tear it down, build it
List up, and generally enjoy it. In particular, students of this material are encouraged
to follow along with the code online as they read. Also included is extensive
documentation gleaned from the code by javadoc. All documentation—within
the book and on the Web—includes pre- and postconditions. The motivation for
this style of commenting is provided in Chapter 2. While it’s hard to be militant
about commenting, this style of documentation provides an obvious, structured
approach to minimally documenting one’s methods that students can appreciate
and users will welcome. These resources, as well as many others, are available
from McGraw-Hill at http://www.mhhe.com/javastructures.
Three icons appear throughout the text, as they do in the margin. The
top “compass” icon highlights the statement of a principle—a statement that
nim encourages abstract discussion. The middle icon marks the first appearance of
a particular class from the structure package. Students will find these files at
McGraw-Hill, or locally, if they’ve been downloaded. The bottom icon similarly
marks the appearance of example code.
Finally, I’d like to note an unfortunate movement away from studying the
implementation of data structures, in favor of studying applications. In the
extreme this is a disappointing and, perhaps, dangerous precedent. The design
of a data structure is like the solution to a riddle: the process of developing the
answer is as important as the answer itself. The text may, however, be used as a
reference for using the structure package in other applications by selectively
avoiding the discussions of implementation.
Preface to the Second Edition
Since the first edition of Java Structures support for writing programs in Java2
has grown considerably. At that time the Java Development Toolkit consisted
of 504 classes in 23 packages3 In Java 1.2 (also called Java 2) Sun rolled out
1520 classes in 59 packages. This book is ready for Java 1.4, where the number
of classes and packages continues to grow.
Most computer scientists are convinced of the utility of Java for program-
ming in a well structured and platform independent manner. While there are
still significant arguments about important aspects of the language (for exam-
ple, support for generic types), the academic community is embracing Java, for
example, as the subject of the Computer Science Advanced Placement Exami-
nation.
It might seem somewhat perplexing to think that many aspects of the origi-
nal Java environment have been retracted (or deprecated) or reconsidered. The
developers at Sun have one purpose in mind: to make Java the indispensable
language of the current generation. As a result, documenting their progress on
the development of data structures gives us valuable insight into the process of
designing useful data structures for general purpose programming. Those stu-
dents and faculty considering a move to this second edition of Java Structures
will see first-hand some of the decisions that have been made in the interven-
ing years. During that time, for example, the Collection-based classes were
introduced, and are generally considered an improvement. Another force—
one similar to calcification—has left a trail of backwards compatible features
that are sometimes difficult to understand. For example, the Iterator class
was introduced, but the Enumeration class was not deprecated. One subject of
the first edition—the notion of Comparable classes—has been introduced into
a number of important classes including String and Integer. This is a step
forward and a reconsideration of what we have learned about that material has
lead to important improvements in the text.
Since the main purpose of the text is to demonstrate the design and behavior
of traditional data structures, we have not generally tracked the progress of
Java where it blurs the view. For example, Java 2 introduces a List interface
(we applaud) but the Vector class has been extended to include methods that
are, essentially, motivated by linked lists (we wonder). As this text points out
frequently, the purpose of an interface is often to provide reduced functionality.
If the data structure does not naturally provide the functionality required by the
application, it is probably not an effective tool for solving the problem: search
elsewhere for an effective structure.
As of this writing, more than 100, 000 individuals have searched for and
downloaded the structure package. To facilitate using the comprehensive set
of classes with the Java 2 environment, we have provided a number of features
that support the use of the structure package in more concrete applications.
Please see Appendix C.
Also new to this edition are more than 200 new problems, several dozen
exercises, and over a dozen labs we regularly use at Williams.
Acknowledgments. Several students, instructors, and classes have helped to
shape this edition of Java Structures. Parth Doshi and Alex Glenday—diligent
Williams students—pointed out a large number of typos and stretches of logic.
Kim Bruce, Andrea Danyluk, Jay Sachs, and Jim Teresco have taught this course
at Williams over the past few years, and have provided useful feedback. I tip
my hat to Bill Lenhart, a good friend and advisor, who has helped improve this
text in subtle ways. To Sean Sandys I am indebted for showing me new ways to
teach new minds.
The various reviewers have made, collectively, hundreds of pages of com-
ments that have been incorporated (as much as possible) into this edition:
Eleanor Hare and David Jacobs (Clemson University), Ram Athavale (North
Carolina State University), Yannick Daoudi (McGill University), Walter Daugh-
erty (Texas A&M University), Subodh Kumar (Johns Hopkins University), Toshimi
Minoura (Oregon State University), Carolyn Schauble (Colorado State Univer-
sity), Val Tannen (University of Pennsylvania), Frank Tompa (University of Wa-
terloo), Richard Wiener (University of Colorado at Colorado Springs), Cynthia
Brown Zickos (University of Mississippi), and my good friend Robbie Moll (Uni-
versity of Massachusetts). Deborah Trytten (University of Oklahoma) has re-
viewed both editions! Still, until expert authoring systems are engineered, au-
thors will remain human. Any mistakes left behind or introduced are purely
those of the author.
The editors and staff at McGraw-Hill–Kelly Lowery, Melinda Dougharty, John
Wannemacher, and Joyce Berendes–have attempted the impossible: to keep me
within a deadline. David Hash, Phil Meek, and Jodi Banowetz are responsible
for the look and feel of things. I am especially indebted to Lucy Mullins, Judy
Gantenbein, and Patti Evers whose red pens have often shown me a better way.
Betsy Jones, publisher and advocate, has seen it all and yet kept the faith:
thanks.
Be aware, though: long after these pages are found to be useless folly, my
best work will be recognized in my children, Kate, Megan, and Ryan. None
of these projects, of course, would be possible without the support of my best
friend, my north star, and my partner, Mary.
Enjoy!
Duane A. Bailey
Williamstown, May 2002
√
Preface to the 7 Edition
In your hand is a special edition of Java Structures designed for use with two
semesters of Williams’ course on data structures, Computer Science 136. This
version is only marginally different than the preceding edition, but is positioned
to make use of Java 5 (the trademarked name for version 1.5 of the JDK).
Because Java 5 may not be available (yet) on the platform you use, most of the
code available in this book will run on older JDK’s. The one feature that would
not be available is Java’s new Scanner class from the java.util package; an
alternative is my ReadStream class, which is lightly documented in Section B.3.1
on page 494. It is a feature of the structure package soon to be removed.
In making this book available in this paperbound format, my hope is that
you find it a more inviting place to write notes: additions, subtractions, and
updates that you’re likely to have discussed in class. Sometimes you’ll identify
improvements, and I hope you’ll pass those along to me. In any case, you can
download the software (as hundreds of thousands have done in the past) and
modify it as you desire.
On occasion, I will release new sections you can incorporate into your text,
including a discussion of how the structure package can make use of generic
types.
I have spent a considerable amount of time designing the structure pack-
age. The first structures were available 8 years ago when Java was still in its
infancy. Many of the structures have since been incorporated (directly or indi-
rectly) into Sun’s own JDK. (Yes, we’ve sold a few books in California.) Still, I
feel the merit of my approach is a slimness that, in the end, you will not find
surprising.
Meanwhile, for those of you keeping track, the following table (adapted
from the 121 cubic inch, 3 pound 6 ounce, Fifth edition of David Flanagan’s
essential Java in a Nutshell) demonstrates the growth of Java’s support:
Cheers!
4 Route 7 is a scenic byway through the Berkshires and Green Mountains that eddies a bit as it
passes through Williamstown and Middlebury.
Chapter 0
Introduction
Y OUR MOTHER probably provided you with constructive toys, like blocks or
Tinkertoys1 or Lego bricks. These toys are educational: they teach us to think
spatially and to build increasingly complex structures. You develop modules
that can be stuck together and rules that guide the building process.
If you are reading this book, you probably enjoyed playing with construc-
tive toys. You consider writing programs an artistic process. You have grown
from playing with blocks to writing programs. The same guidelines for building
structures apply to writing programs, save one thing: there is, seemingly, no
limit to the complexity of the programs you can write. I lie.
Well, almost. When writing large programs, the data structures that main-
tain the data in your program govern the space and time consumed by your
running program. In addition, large programs take time to write. Using differ-
ent structures can actually have an impact on how long it takes to write your
program. Choosing the wrong structures can cause your program to run poorly
or be difficult or impossible to implement effectively.
Thus, part of the program-writing process is choosing between different
structures. Ideally you arrive at solutions by analyzing and comparing their
various merits. This book focuses on the creation and analysis of traditional
data structures in a modern programming environment, The Java Programming
Language, or Java for short.
0.1 Read Me
As might be expected, each chapter is dedicated to a specific topic. Many of the
topics are concerned with specific data structures. The structures we will inves-
tigate are abstracted from working implementations in Java that are available
to you if you have access to the Internet.2 Other topics concern the “tools of the
Author: L. W. King
Language: English
BABYLONIA
FROM THE FOUNDATION OF THE MONARCHY
TO THE PERSIAN CONQUEST
BY
LEONARD W. KING, LITT.D., F.S.A.
Assistant Keeper of Egyptian and Assyrian
Antiquities in the British Museum
Professor of Assyrian and Babylonian Archæology
in
the University of London
WITH MAP, PLANS, AND ILLUSTRATIONS
LONDON
1915
MERODACH-BALADAN II., KING OF BABYLON, MAKING A
GRANT OF LAND TO BÊL-AKHÊ-ERBA, GOVERNOR OF
BABYLON.
The first part of Leonard W. King's History of Babylon is available as A History of Sumer and Akkad,
an Account of the Early Races of Babylonia from Prehistoric Times to the Foundation of the
Babylonian Monarchy.
PREFACE
In the first volume of this work an account was given of the early races of
Babylonia from prehistoric times to the foundation of the monarchy. It
closed at the point when the city of Babylon was about to secure the
permanent leadership under her dynasty of West-Semitic kings. The present
volume describes the fortunes of Babylonia during the whole of the dynastic
period, and it completes the history of the southern kingdom. Last autumn,
in consequence of the war, it was decided to postpone its publication; but,
at the request of the publishers, I have now finished it and seen it through
the press. At a time when British troops are in occupation of Southern
Mesopotamia, the appearance of a work upon its earlier history may
perhaps not be considered altogether inopportune.
Thanks to recent excavation Babylon has ceased to be an abstraction, and
we are now able to reconstitute the main features of one of the most
famous cities of the ancient world. Unlike Ashur and Nineveh, the great
capitals of Assyria, Babylon survived with but little change under the
Achæmenian kings of Persia, and from the time of Herodotus onward we
possess accounts of her magnificence, which recent research has in great
part substantiated. It is true that we must modify the description Herodotus
has left us of her size, but on all other points the accuracy of his
information is confirmed. The Lion Frieze of the Citadel and the enamelled
beasts of the Ishtar Gate enable us to understand something of the spell
she cast. It is claimed that the site has been identified of her most famous
building, the Hanging Gardens of the royal palace; and, if that should prove
to be the case, they can hardly be said to have justified their reputation.
Far more impressive is the Tower of Babel with its huge Peribolos, enclosing
what has been aptly described as the Vatican of Babylon.
The majority of the buildings uncovered date from the Neo-Babylonian
period, but they may be regarded as typical of Babylonian civilization as a
whole. For temples were rebuilt again and again on the old lines, and
religious conservatism retained the mud-brick walls and primitive decoration
of earlier periods. Even Nabopolassar's royal palace must have borne a
close resemblance to that of Hammurabi; and the street network of the city
appears to have descended without much change from the time of the First
Dynasty. The system which Hammurabi introduced into the legislation of his
country may perhaps have been reflected in the earliest attempt at town-
planning on a scientific basis. The most striking fact about Babylon's history
is the continuity of her culture during the whole of the dynastic period. The
principal modification which took place was in the system of land-tenure,
the primitive custom of tribal or collective proprietorship giving place to
private ownership under the policy of purchase and annexation deliberately
pursued by the West-Semitic and Kassite conquerors. A parallel to the
earlier system and its long survival may be seen in the village communities
of India at the present day.
In contrast to that of Assyria, the history of Babylon is more concerned with
the development and spread of a civilization than with the military
achievements of a race. Her greatest period of power was under her first
line of kings; and in after ages her foreign policy was dictated solely by her
commercial needs. The letters from Boghaz Keui, like those from Tell el-
Amarna, suggest that, in keeping her trade connexions open, she relied
upon diplomacy in preference to force. That she could fight at need is
proved by her long struggle with the northern kingdom, but in the later
period her troops were never a match for the trained legions of Assyria. It
is possible that Nabopolassar and his son owed their empire in great
measure to the protecting arm of Media; and Nebuchadnezzar's success at
Carchemish does not prove that the Babylonian character had suddenly
changed. A recently recovered letter throws light on the unsatisfactory state
of at least one section of the army during Nebuchadnezzar's later years,
and incidentally it suggests that Gobryas, who facilitated the Persian
occupation, may be identified with a Babylonian general of that name. With
the fall of Media, he may perhaps have despaired of any successful
opposition on his country's part.
Babylon's great wealth, due to her soil and semi-tropical climate, enabled
her to survive successive foreign dominations and to impose her civilization
on her conquerors. Her caravans carried that civilization far afield, and one
of the most fascinating problems of her history is to trace the effect of such
intercourse in the literary remains of other nations. Much recent research
has been devoted to this subject, and the great value of its results has
given rise in some quarters to the view that the religious development of
Western Asia, and in a minor degree of Europe, was dominated by the
influence of Babylon. The theory which underlies such speculation assumes
a reading of the country's history which cannot be ignored. In the
concluding chapter an estimate has been attempted of the extent to which
the assumption is in harmony with historical research.
The delay in the publication of this volume has rendered it possible to
incorporate recent discoveries, some of which have not as yet appeared in
print. Professor A. T. Clay has been fortunate enough to acquire for the Yale
University Collection a complete list of the early kings of Larsa, in addition
to other documents with an important bearing on the history of Babylon.
He is at present preparing the texts for publication, and has meanwhile very
kindly sent me transcripts of the pertinent material with full permission to
make use of them. The information afforded as to the overlapping of
additional dynasties with the First Dynasty of Babylon has thrown new light
on the circumstances which led to the rise of Babylon to power. But these
and other recent discoveries, in their general effect, do not involve any
drastic changes in the chronological scheme as a whole. They lead rather to
local rearrangements, which to a great extent counterbalance one another.
Under Babylon's later dynasties her history and that of Assyria are so
closely inter-related that it is difficult to isolate the southern kingdom. An
attempt has been made to indicate broadly the chief phases of the conflict,
and the manner in which Babylonian interests alone were affected. In order
to avoid needless repetition, a fuller treatment of the period is postponed to
the third volume of this work. A combined account will then also be given of
the literature and civilization of both countries.
I take this opportunity of expressing my thanks to Monsieur F. Thureau-
Dangin, Conservateur-adjoint of the Museums of the Louvre, for allowing
me last spring to study unpublished historical material in his charge. The
information he placed at my disposal I found most useful during
subsequent work in the Ottoman Museum at Constantinople shortly before
the war. Reference has already been made to my indebtedness to Professor
Clay, who has furnished me from time to time with other unpublished
material, for which detailed acknowledgment is made in the course of this
work. With Professor C. F. Burney I have discussed many of the problems
connected with the influence of Babylon upon Hebrew literature; and I am
indebted to Professor A. C. Headlam for permission to reprint portions of an
article on that subject, which I contributed in 1912 to the Church Quarterly
Review.
To Dr. E. A. Wallis Budge my thanks are due, as he suggested that I should
write these histories, and he has given me the benefit of his advice. To him,
as to Sir Frederic Kenyon and Mr. D. G. Hogarth, I am indebted for
permission to make use of illustrations, which have appeared in official
publications of the British Museum. My thanks are also due to Monsieur
Ernest Leroux of Paris for allowing me to reproduce some of the plates from
the "Mémoires de la Délégation en Perse," published by him under the
editorship of Monsieur J. de Morgan; and to the Council and Secretary of
the Society of Biblical Archæology for the loan of a block employed to
illustrate a paper I contributed to their Proceedings. The greater number of
the plates illustrating the excavations are from photographs taken on the
spot; and the plans and drawings figured in the text are the work of Mr. E.
J. Lambert and Mr. C. O. Waterhouse, who have spared no pains to ensure
their accuracy. The designs upon the cover of this volume represent the two
most prominent figures in Babylonian tradition. In the panel on the face of
the cover the national hero Gilgamesh is portrayed, whose epic reflects the
Babylonian heroic ideal. The panel on the back of the binding contains a
figure of Marduk, the city-god of Babylon, grasping in his right hand the
flaming sword with which he severed the dragon of chaos.
L. W. KING.
CONTENTS
CHAPTER I
INTRODUCTORY: BABYLON'S PLACE IN THE HISTORY OF ANTIQUITY
Babylon as a centre of civilization—Illustrations of foreign influence—
Babylon's share in the origin of the culture she distributed—Causes
which led to her rise as capital—Advantages of her geographical
position—Transcontinental lines of traffic—The Euphrates route, the
Royal Road, and the Gates of Zagros—Her supremacy based on the
strategic and commercial qualities of her site—The political centre of
gravity in Babylonia illustrated by the later capitals, Seleucia,
Ctesiphon, and Baghdad—The Persian Gulf as barrier, and as channel
of international commerce—Navigation on the Euphrates and the Tigris
—Causes of Babylon's deposition—Her treatment by Cyrus, Alexander,
and Seleucus—The Arab conquest of Mesopotamia instructive for
comparison with the era of early city-states—Effect of slackening of
international communications—Effect of restoration of commercial
intercourse with the West—Three main periods of Babylon's foreign
influence—Extent to which she moulded the cultural development of
other races-Traces of contact in Hebrew religion and in Greek
mythology—Recent speculation on the subject to be tested by the
study of history 1
CHAPTER II
THE CITY OF BABYLON AND ITS REMAINS: A DISCUSSION OF THE RECENT
EXCAVATIONS
The site of Babylon in popular tradition—Observations of Benjamin of
Tudela and John Eldred—Exaggerations of early travellers—The
description of Herodotus—Modern survey and excavation—
Characteristics of Babylonian architecture—The architect's ideal—
Comparison of Babylonian and Assyrian architectural design—
Difficulties of Babylonian excavation—The extent of Babylon and the
classical tradition—Remains of the ancient city—The Walls of Babylon—
The Outer City-wall—The Mound Bâbil—The Ḳaṣr—The Inner City-wall—
Imgur-Bêl and Nimitti-Bêl—Quay-walls and fortifications—
Nebuchadnezzar's river-fortification—Change in the course of the
Euphrates—Palaces of Nabopolassar and Nebuchadnezzar—The official
courts of the palace—Al-Bît-shar-Bâbili—The Throne-Room and its
enamelled façade—The private palace and the women's apartments—
The Hanging Gardens of Babylon—The Ishtar Gate and its Bulls and
Dragons—Later defences of the Southern Citadel —The Lion Frieze—
The Procession Street—Temples of Babylon—E-makh, the temple of
Ninmakh—Altars in the Babylonian and Hebrew cults—The unidentified
temple—The temple of Ishtar of Akkad—Religious mural decoration—
The temple of Ninib—E-sagila and the Tower of Babylon—The Peribolos
or Sacred Precincts—E-zida and the Temple-tower of Borsippa—The
Euphrates bridge—Merkes and the street net-work of Babylon—Strata
of different periods—Early Babylonian town-planning—Material
influence of the West-Semitic Dynasty—Continuity of Babylonian
culture 14
CHAPTER III
THE DYNASTIES OF BABYLON: THE CHRONOLOGICAL SCHEME IN THE LIGHT OF
RECENT DISCOVERIES
Chronology the skeleton of history—Principal defect in the Babylonian
scheme—The Dynasties of Nîsin, Larsa and Babylon—Discovery of a
List of the kings of Larsa—Introduction of fresh uncertainty—
Relationship of the kings of Babylon and Nîsin—Absence of
synchronisms—Evidence of date-formula?.—A fresh and sounder line of
research—Double-dates supply the missing link for the chronology—
The Nîsin era—Explanation of the double-dates—The problem of Rîm-
Sin—Method of reconciling data—Another line of evidence—
Archæological research and the Second Dynasty of the Kings' List—
Date-formulæ of Hammurabi, Samsu-iluna and Iluma-ilum—Methods of
fixing period of First Dynasty—Ammi-zaduga's omens from the planet
Venus—Combinations of Venus, sun, and moon—Possibility of fixing
period of observations—Alternative dates in their relation to historical
results—The time of harvest in farming-out contracts of the period—
Probable date for the First Dynasty—Re-examination of chronological
notices in later texts—The Dynasties of Berossus and the beginning of
his historical period—Effect of recent discoveries on the chronological
scheme as a whole—Our new picture of the rise of Babylon 87
CHAPTER IV
THE WESTERN SEMITES AND THE FIRST DYNASTY OF BABYLON
Original home of the Amurru, or Western Semites—Arabia one of the
main breeding-grounds of the human race—The great Semitic
migrations and their cause—Evidence of diminution of rainfall in Arabia
—The life of the pastoral nomad conditioned by the desert—The
change from pastoral to agricultural life—Successive stages of
Canaanite civilization—The neolithic inhabitants and the Amorite
migration—Canaanites of history and their culture—Eastern Syria and
the middle Euphrates—Recent excavations at Carchemish and its
neighbourhood—Early Babylonian cylinder-seals on the Sajûr—Trade of
Carchemish with Northern Babylonia—West Semitic settlements on the
Khâbûr—The kingdom of Khana—The Amorite invasion of Babylonia—
The Dynasties of Nîsin and Larsa—Recent discoveries at Ashur—Proto-
Mitannians—The Western Semites in Babylon and their conflict with
Assyria—Early struggles and methods of expansion—The Elamite
conquest of Larsa—The three-cornered contest of Nîsin, Elam and
Babylon—The fall of Nîsin and the duel between Babylon and Elam—
Hammurabi's defeat of Rîm-Sin and the annexation of Sumer by
Babylon—Extent of Hammurabi's empire—Hammurabi the founder of
Babylon's greatness—His work as law-giver and administrator 119
CHAPTER V
THE AGE OF HAMMURABI AND ITS INFLUENCE ON LATER PERIODS
The energy of the Western Semite and his perpetuation of a dying
culture—His age one of transition—Contemporaneous evidence on
social and political conditions—The three grades in the social scale of
Babylon—The nobles a racial aristocracy—Origin and rights of the
middle class—Condition of slaves—Pastoral and agricultural life in early
Babylonia—Regulations sanction long-established custom—The corvée
for public works—Canals and fishing-rights—Methods of irrigation and
their modern equivalents—Survival of the Babylonian plough and grain-
drill—Importance of the date-palm and encouragement of plantations—
Methods of transport by water—The commercial activities of Babylon
and the larger cities—Partnerships for foreign trade—Life in the towns
—Family life in early Babylonia—The position of women—Privileges
enjoyed by votaries—The administration of justice—Relation of the
crown and the priestly hierarchy under the Western Semites—The royal
regulation of the calendar and the naming of the year—System of
administration—Changes in the religious sphere and revision of the
pantheon—Literary activity—The complete semitization of the country
unaccompanied by any break in culture—Babylon's later civilization
moulded by Hammurabi's age 162
CHAPTER VI
THE CLOSE OF THE FIRST DYNASTY OF BABYLON AND THE KINGS FROM THE
COUNTRY OF THE SEA
Condition of the empire on Samsu-iluna's accession—Early Kassite raid
the signal for revolt, assisted by Elamite invasion—Resources of
Babylon strained in suppressing the rebellion—Rise of an independent
kingdom in the Sea-Country on the littoral of the Persian Gulf—Capacity
of the Sea-Country for defence and as a base for offensive operations
—Sumerian elements in its population—Babylon's loss of territory and
her struggle with the Sea-Country kings—Symptoms of decadence
under the later West-Semitic kings of Babylon—The deification of
royalty and increased luxury of ritual—Evidence of Babylon's growing
wealth and artistic progress under foreign influence—Temporary
restoration of Babylon's power under Ammi-ditana—Renewed activity
of the Sea-Country followed by gradual decline of Babylon—The close
of the West-Semitic dynasty brought about or hastened by Hittite
invasion—Period of local dynasties following the fall of Babylon—
Continued succession of the Sea-Country kings 197
CHAPTER VII
THE KASSITE DYNASTY AND ITS RELATIONS WITH EGYPT AND THE HITTITE
EMPIRE
The Kassite conquest of Babylonia—The Kassites probably Aryans by
race and akin to the later rulers of Mitanni—Character of their rule in
Babylon—Their introduction of the horse into Western Asia—The
Kassite conquest of the Sea-Country and its annexation to Babylon—
Gap in our knowledge of the Kassite succession—The letters from Tell
el-Amarna and Boghaz-Keui—Egypt and Western Asia at the close of
the fifteenth century—Diplomacy and the balance of power—Dynastic
marriages and international intercourse of the period—Amen-hetep III.
and Kadashman-Enlil—Akhenaten and his policy of doles—Babylon's
caravans in Syria—The correspondence of Burna-Buriash and
Akhenaten—Egypt's loss of her Asiatic provinces—Rise of the Hittite
Empire—The Hittites and their civilization—Their capital of Khatti—Their
annexation of Mitanni and the Egyptian war—The relations of Khattusil
with Kadashman-turgu and Kadashman-Enlil II.—Character of the
Hittite correspondence—The growth of Assyria and her relations with
Babylon—First phase in the long struggle of the two kingdoms —The
later members of the Kassite Dynasty—Its fall to be traced to Elamite
invasion—Economic conditions in Babylonia under the Kassites—
Kudurru-inscriptions or boundary-stones—Their evidence on the
Babylonian system of land-tenure—Gradual disappearance of tribal
proprietorship as a result of West-Semitic and Kassite policy—Transition
from collective to private ownership 214
CHAPTER VIII
THE LATER DYNASTIES AND THE ASSYRIAN DOMINATION
INDEX 323
LIST OF PLATES
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.
ebooknice.com