Data Structures And Problem Solving Using Java 4th Edition by Mark Weiss 0321541405 9780321541406 pdf download
Data Structures And Problem Solving Using Java 4th Edition by Mark Weiss 0321541405 9780321541406 pdf download
https://ebookball.com/product/data-structures-and-problem-
solving-using-java-4th-edition-by-mark-
weiss-0321541405-9780321541406-17186/
https://ebookball.com/product/data-structures-and-problem-solving-
using-java-4th-edition-by-mark-allen-weiss-
isbn-0321541405-978-0321541406-16342/
https://ebookball.com/product/data-structures-and-problem-solving-
using-c-2nd-edition-by-malik-isbn-0324782012-978-0324782011-16350/
https://ebookball.com/product/data-structures-and-algorithm-analysis-
in-c-4th-edition-by-mark-weiss-013284737x-9780132847377-15292/
https://ebookball.com/product/problem-solving-in-data-structures-and-
algorithms-using-c-1st-edition-by-hemant-jain-
isbn-9352655915-9789352655915-15768/
Problem Solving in Data Structures and Algorithms Using C
1st Edition by Hemant Jain ISBN 1540407306 9781540407306
https://ebookball.com/product/problem-solving-in-data-structures-and-
algorithms-using-c-1st-edition-by-hemant-jain-
isbn-1540407306-9781540407306-15866/
https://ebookball.com/product/data-structures-and-algorithm-analysis-
in-javatm-3rd-edition-by-mark-weiss-9780133465013-0133465012-18710/
https://ebookball.com/product/data-structures-abstraction-and-design-
using-java-2rd-edition-by-elliot-koffman-paul-
wolfgang-9781119239147-15300/
Data Structures &
Problem Solving
Using Java
fourth edition
This page intentionally left blank
Data Structures &
Problem Solving
Using Java
fourth edition
ISBN-13: 9780321541406
ISBN-10: 0321541405
1 2 3 4 5 6 7 8 9 10⎯CRS⎯12 11 10 09
To David and David.
This page intentionally left blank
preface
preface
T his book is designed for a two-semester sequence in computer science,
beginning with what is typically known as Data Structures and continuing
with advanced data structures and algorithm analysis. It is appropriate for the
courses from both the two-course and three-course sequences in “B.1 Intro-
ductory Tracks,” as outlined in the final report of the Computing Curricula
2001 project (CC2001)—a joint undertaking of the ACM and the IEEE.
The content of the Data Structures course has been evolving for some
time. Although there is some general consensus concerning topic coverage,
considerable disagreement still exists over the details. One uniformly
accepted topic is principles of software development, most notably the con-
cepts of encapsulation and information hiding. Algorithmically, all Data
Structures courses tend to include an introduction to running-time analysis,
recursion, basic sorting algorithms, and elementary data structures. Many uni-
versities offer an advanced course that covers topics in data structures, algo-
rithms, and running-time analysis at a higher level. The material in this text
has been designed for use in both levels of courses, thus eliminating the need
to purchase a second textbook.
Although the most passionate debates in Data Structures revolve around
the choice of a programming language, other fundamental choices need to be
made:
summary of changes
in the fourth edition
1. This edition provides additional discussion on using classes (Chapter 2),
writing classes (Chapter 3), and interfaces (Chapter 4).
2. Chapter 6 contains additional material discussing the running time of
lists, the use of maps, and the use of views in the Java Collections API.
3. The Scanner class is described, and code throughout the text makes use
of the Scanner class.
4. Chapter 9 describes and implements the 48-bit linear congruential gener-
ator that is part of both the Java and many C++ libraries.
5. Chapter 20 has new material on separate chaining hash tables and the
String hashCode method.
6. There are numerous revisions to the text that improve on the prose in the
previous edition.
7. Many new exercises are provided in Parts I, II, and IV.
a unique approach
My basic premise is that software development tools in all languages come with
large libraries, and many data structures are part of these libraries. I envision an
eventual shift in emphasis of data structures courses from implementation to
preface ix
use. In this book I take a unique approach by separating the data structures into
their specification and subsequent implementation and taking advantage of an
already existing data structures library, the Java Collections API.
A subset of the Collections API suitable for most applications is discussed
in a single chapter (Chapter 6) in Part Two. Part Two also covers basic analy-
sis techniques, recursion, and sorting. Part Three contains a host of applica-
tions that use the Collections API’s data structures. Implementation of the
Collections API is not shown until Part Four, once the data structures have
already been used. Because the Collections API is part of Java, students can
design large projects early on, using existing software components.
Despite the central use of the Collections API in this text, it is neither a book
on the Collections API nor a primer on implementing the Collections API spe-
cifically; it remains a book that emphasizes data structures and basic problem-
solving techniques. Of course, the general techniques used in the design of data
structures are applicable to the implementation of the Collections API, so sev-
eral chapters in Part Four include Collections API implementations. However,
instructors can choose the simpler implementations in Part Four that do not dis-
cuss the Collections API protocol. Chapter 6, which presents the Collections
API, is essential to understanding the code in Part Three. I attempted to use only
the basic parts of the Collections API.
Many instructors will prefer a more traditional approach in which each
data structure is defined, implemented, and then used. Because there is no
dependency between material in Parts Three and Four, a traditional course can
easily be taught from this book.
prerequisites
Students using this book should have knowledge of either an object-oriented
or procedural programming language. Knowledge of basic features, including
primitive data types, operators, control structures, functions (methods), and
input and output (but not necessarily arrays and classes) is assumed.
Students who have taken a first course using C++ or Java may find the first
four chapters “light” reading in some places. However, other parts are definitely
“heavy” with Java details that may not have been covered in introductory courses.
Students who have had a first course in another language should begin at
Chapter 1 and proceed slowly. If a student would like to use a Java reference
book as well, some recommendations are given in Chapter 1.
Knowledge of discrete math is helpful but is not an absolute prerequi-
site. Several mathematical proofs are presented, but the more complex
proofs are preceded by a brief math review. Chapters 7 and 19–24 require
x preface
java
This textbook presents material using the Java programming language. Java
is a language that is often examined in comparison with C++. Java offers
many benefits, and programmers often view Java as a safer, more portable,
and easier-to-use language than C++.
The use of Java requires that some decisions be made when writing a text-
book. Some of the decisions made are as follows:
1. The minimum required compiler is Java 5. Please make sure you are
using a compiler that is Java 5-compatible.
2. GUIs are not emphasized. Although GUIs are a nice feature in Java,
they seem to be an implementation detail rather than a core Data
Structures topic. We do not use Swing in the text, but because many
instructors may prefer to do so, a brief introduction to Swing is pro-
vided in Appendix B.
3. Applets are not emphasized. Applets use GUIs. Further, the focus of
the course is on data structures, rather than language features. Instruc-
tors who would like to discuss applets will need to supplement this
text with a Java reference.
4. Inner classes are used. Inner classes are used primarily in the imple-
mentation of the Collections API, and can be avoided by instructors
who prefer to do so.
5. The concept of a pointer is discussed when reference variables are
introduced. Java does not have a pointer type. Instead, it has a refer-
ence type. However, pointers have traditionally been an important
Data Structures topic that needs to be introduced. I illustrate the
concept of pointers in other languages when discussing reference
variables.
6. Threads are not discussed. Some members of the CS community
argue that multithreaded computing should become a core topic in the
introductory programming sequence. Although it is possible that this
will happen in the future, few introductory programming courses dis-
cuss this difficult topic.
preface xi
text organization
In this text I introduce Java and object-oriented programming (particularly
abstraction) in Part One. I discuss primitive types, reference types, and some
of the predefined classes and exceptions before proceeding to the design of
classes and inheritance.
In Part Two, I discuss Big-Oh and algorithmic paradigms, including
recursion and randomization. An entire chapter is devoted to sorting, and a
separate chapter contains a description of basic data structures. I use the Col-
lections API to present the interfaces and running times of the data structures.
At this point in the text, the instructor may take several approaches to present
the remaining material, including the following two.
1. Discuss the corresponding implementations (either the Collections
API versions or the simpler versions) in Part Four as each data struc-
ture is described. The instructor can ask students to extend the classes
in various ways, as suggested in the exercises.
2. Show how each Collections API class is used and cover implementa-
tion at a later point in the course. The case studies in Part Three can
be used to support this approach. As complete implementations are
available on every modern Java compiler, the instructor can use the
Collections API in programming projects. Details on using this
approach are given shortly.
Part Five describes advanced data structures such as splay trees, pairing
heaps, and the disjoint set data structure, which can be covered if time permits
or, more likely, in a follow-up course.
the general concept of a pointer—even though Java does not have pointers—so
that students learn this important Data Structures topic. Several of the basic
reference types (strings, arrays, files, and Scanners) are illustrated, and the use
of exceptions is discussed. Chapter 3 continues this discussion by describing
how a class is implemented. Chapter 4 illustrates the use of inheritance in
designing hierarchies (including exception classes and I/O) and generic com-
ponents. Material on design patterns, including the wrapper, adapter, and dec-
orator patterns can be found in Part One.
Part Two focuses on the basic algorithms and building blocks. In
Chapter 5 a complete discussion of time complexity and Big-Oh notation
is provided. Binary search is also discussed and analyzed. Chapter 6 is
crucial because it covers the Collections API and argues intuitively what
the running time of the supported operations should be for each data struc-
ture. (The implementation of these data structures, in both Collections
API-style and a simplified version, is not provided until Part Four). This
chapter also introduces the iterator pattern as well as nested, local, and
anonymous classes. Inner classes are deferred until Part Four, where they
are discussed as an implementation technique. Chapter 7 describes recur-
sion by first introducing the notion of proof by induction. It also discusses
divide-and-conquer, dynamic programming, and backtracking. A section
describes several recursive numerical algorithms that are used to imple-
ment the RSA cryptosystem. For many students, the material in the second
half of Chapter 7 is more suitable for a follow-up course. Chapter 8
describes, codes, and analyzes several basic sorting algorithms, including
the insertion sort, Shellsort, mergesort, and quicksort, as well as indirect
sorting. It also proves the classic lower bound for sorting and discusses the
related problems of selection. Finally, Chapter 9 is a short chapter that dis-
cusses random numbers, including their generation and use in randomized
algorithms.
Part Three provides several case studies, and each chapter is organized
around a general theme. Chapter 10 illustrates several important techniques
by examining games. Chapter 11 discusses the use of stacks in computer lan-
guages by examining an algorithm to check for balanced symbols and the
classic operator precedence parsing algorithm. Complete implementations
with code are provided for both algorithms. Chapter 12 discusses the basic
utilities of file compression and cross-reference generation, and provides a
complete implementation of both. Chapter 13 broadly examines simulation by
looking at one problem that can be viewed as a simulation and then at the
more classic event-driven simulation. Finally, Chapter 14 illustrates how data
preface xiii
chapter dependencies
Generally speaking, most chapters are independent of each other. However,
the following are some of the notable dependencies.
n Part One (Tour of Java): The first four chapters should be covered in their
entirety in sequence first, prior to continuing on to the rest of the text.
n Chapter 5 (Algorithm Analysis): This chapter should be covered prior
to Chapters 6 and 8. Recursion (Chapter 7) can be covered prior to
this chapter, but the instructor will have to gloss over some details
about avoiding inefficient recursion.
n Chapter 6 (The Collections API): This chapter can be covered prior to
or in conjunction with material in Part Three or Four.
n Chapter 7 (Recursion): The material in Sections 7.1–7.3 should be
covered prior to discussing recursive sorting algorithms, trees, the
Tic-Tac-Toe case study, and shortest-path algorithms. Material such
as the RSA cryptosystem, dynamic programming, and backtracking
(unless Tic-Tac-Toe is discussed) is otherwise optional.
n Chapter 8 (Sorting Algorithms): This chapter should follow Chapters
5 and 7. However, it is possible to cover Shellsort without Chapters 5
and 7. Shellsort is not recursive (hence there is no need for Chapter 7),
and a rigorous analysis of its running time is too complex and is not
covered in the book (hence there is little need for Chapter 5).
n Chapter 15 (Inner Classes and Implementations of ArrayLists):
This material should precede the discussion of the Collections API
implementations.
n Chapters 16 and 17 (Stacks and Queues/Linked Lists): These chapters
may be covered in either order. However, I prefer to cover Chapter 16
first because I believe that it presents a simpler example of linked lists.
n Chapters 18 and 19 (Trees/ Binary Search Trees): These chapters can
be covered in either order or simultaneously.
separate entities
The other chapters have little or no dependencies:
I was now alone in the quiet woods. The sounds of trampling horses
had died away, and the little rill beside me trickled peacefully in the
still night. I reached my hand down, and, filling my glove with water,
poured it over my face. It was cool and refreshing, and in a few
moments I was able to rise. I looked at the stream—at the log,
beneath which lay my sabre—and at the tree, beneath which lay my
horse; and then, making an effort, I stepped upon the log, and
crossed into the thick brushwood on the other side. But a few steps
were taken when I was glad to sit down upon a fallen tree. I felt
stunned and faint, yet hoped I was gathering strength and would
soon be able to go on. As I was thus seated the question arose,
What should I do? Fort Henry, I knew, was eastward of me. Should I
go there?—it was but thirty-five or forty miles. No! the country
between must be swarming with rebels. Should I go to Paducah? It
was sixty miles northward, and the enemy would, doubtless, follow
in that direction. Should I remain hidden in the woods, trusting to
their leaving in a few days? Should I crawl to some barn or stack,
and take the chance of their not searching it? Would my strength
hold out if I went on? and would the fractured bone, that I felt
under my coat, and the growing pain in my side, do without the
surgeon's care till I could make my way out?
At length I decided on my course: I would go northward till daylight,
and thus be some miles ahead; then I would turn eastward, and
thus place myself on one side of their probable line of march. During
the next day I hoped to meet a contraband, and, obtaining
information, then decide whether to continue eastward, toward Fort
Henry, or turn northward again to Paducah.
Thus deciding, I took out my handkerchief and tied my pistol round
my waist, and then rose from the tree to begin my journey. The
broken ribs made it painful to breathe, and my right arm had to be
supported constantly by my left. Around me, all was beautiful and
serene. The calm moon shone, in peaceful contrast with the exciting
scene I had lately witnessed, and lighted my steps and pointed my
way. No sound disturbed the stillness of the woods, save that from a
distant farm there came the tinkle of a cow-bell. It was in the
direction I wished to go, and toward it I slowly made my way. A
friend had brought me down the April number of the "Atlantic"
before leaving camp, and I had read Whittier's "Mountain Pictures."
A line of it came to my mind:
and I wondered whether any other reader would ever thus apply it.
I had to walk slowly through the silvery-lighted woods; but at last
drew near the ringing noise, and climbed the hill, on the top of
which were the farm and barnyard of the cows. A road ran along the
brow of the hill, and on the other side of it appeared some wide
fields. To the left was a clump of apple-trees, and the hoarse bark of
a dog told me they covered a house. I stopped a few moments to
rest and listen, and then stepped cautiously into the road. On the
opposite side was a large tree, and in its shadow I tried to climb the
high rail fence. I was weaker than I had supposed. My limbs refused
at first to lift my weight, and my one arm could not keep me from
swinging round against the fence. Twice I thought I must give it up;
but, after several efforts, I mounted it, and then, holding my breath,
I let myself drop down on the other side.
Across the wide field there was another road. I had not gone far
when I heard a noise in the woods, and, fearing it might be a picket
of the enemy, I lay down beside the fence. The moon was then near
the horizon, and I deemed it most prudent to wait till she had set.
Soon after this I came upon some cows, and these I drove before
me. I thought that if there should be a picket in the road the cows
would turn off, and there would be less likelihood of my being seen
or heard. After going, I should think, a mile, we came to a broad
road. This the cows crossed; and I was about to follow, when a large
dog came from a house beyond, and, after barking furiously at the
cows, came toward me. I took my pistol out, and was prepared to
fire, when the dog stopped barking. It was well for me he did so, for
within a few yards I heard horses coming up the road. I looked, and
saw the outline of some horsemen. There was no time to fly. I sank
quietly down upon the ground, and lay still. The horsemen came on.
They seemed a picket. One rode in front, who seemed a sergeant,
and the others followed. They passed close by me—so close, I could
hear the jingling of their spurs.
When they had passed I rose, and determined that thereafter I
would not go upon any road or cross any field, or spare any pains. I
entered the woods. They were now thick, with underbrush, and I
had not the moon to guide me. Frequently I had wanted the North
star on night marches, but it had always been hidden by clouds.
Now, however, on this night, when I needed it above all others, it
shone out beautiful and bright. As I watched it, it seemed an old
friend, reappearing to aid me, and again and again as I emerged
from some thick underwood, and turned toward its constant blaze, I
felt as if it were the companion of my flight. But even with its aid, I
encountered difficulties. Sometimes the trees would hide it, and
often I had to keep my eyes fixed on my path or strained on
suspicious objects around me. My plan was to take some distant hill
for a land-mark, and on reaching it, to look for another, and make
toward it. Yet fallen trees and deep hollows often made me change
my course, and sometimes made me lose it, and then I had to
search the sky, and refind the star before I could go on. As I could
not use my hands, I was forced to push my way through the brush
with my left shoulder. I had lost my hat, too, in the fall, and my hair
often caught in the branches. So my progress was slow and
wearisome, with no help around me, but with hope before.
I should think it was about three o'clock in the morning, when, from
the top of a little hill, there appeared just before me the smoking,
smouldering fires of a camp. I knew if it were a camp, that I was
within the lines. I turned, therefore, and made my way back as a
burglar might glide through a house—sliding my feet along the
ground, lest I should tread upon some crackling branch—choosing
the thickest wood and the darkest shade. About an hour later, I saw,
as I thought, some tents, but knew it was most improbable there
should be any there; so I stopped to examine, and then saw they
were but the grey light of morning breaking through the trees. It
was a welcome sight; yet I confess the night had not seemed long,
and that I was surprised to find the morning come.
I now changed my course, and turned toward the east. The woods
changed too. There were small trees, with little underbrush, and the
ground was a smooth, descending plain. I kept on over this for
miles. The sky brightened; the sun rose, and mounted higher and
higher. I heard the barking of dogs, the lowing of cattle, and
occasionally the voices of men and children. I came, too, upon
roads, and these had to be crossed with great caution, coming out
step by step, looking carefully up and down, listening anxiously, and
they hurrying across and plunging into the woods on the other side.
Whence these roads came or where they went, I neither knew nor
cared. I was ignorant of the country, but not compelled to ask my
way. For once, I was strangely independent, and needed only to look
toward the sun and travel east.
Later I came upon fields and farms, and round these I had to make
long circuits. One chain of farms, I thought I never should get
through. Again and again I was forced to go back and try again. The
temptation to break through my resolution, and cross just this one,
or that one, was very strong; and I found that making one's escape,
like any other success, depends on his resolution and perseverance.
Toward noon, as I was approaching a road, I heard children's voices.
I looked, and saw, or thought I saw, a man on horseback. He sat
still as though on guard, and I supposed he was one of the enemy's
picket. The woods were thin, so I lay down and drew the bushes
over me. I watched him, but he did not move, and I soon decided I
must stay there as long as he did. Notwithstanding my anxiety, I fell
into a doze, probably not for a minute, yet when I opened my eyes,
the man was gone, and a tree stood in his place. It was an optical
illusion. My eyes had been over-worked for three nights, and for the
last twenty hours, constantly strained in examining objects far and
near. The moment's rest had dispelled the apparition. I remembered
that as the sun was rising that morning, I had long doubted whether
a clump of bushes was not a group of my own men—that trees and
stumps had several times been changed to sentinels and guards;
and I remembered, also, the tents in the morning, and the camp-
fires during the night.
I now began to suffer from thirst, for I could only drink by dipping
up water with one hand. The sun, too, beat down through the half-
leaved trees, and became painful. I twisted some leaves into a sort
of cap, but it was often brushed off, and at best made but a poor
shelter. I had been disappointed also in not meeting a contraband.
Some I had seen in fields, but always with white men, and them I
must shun; and as I did so, I asked myself whether this was the
United States, and these Americans, that I should be time skulking
like a hunted criminal.
Feeling now and then a little faint, I decided on going to a house for
something to eat, and again plunging into the woods. Yet here great
caution was necessary. I wanted a small house, because it would
probably contain but one man, and I must have it out of sight of
neighbors and near woods. I passed several, but none of them
complied with my conditions—one was too large, another too far
back in an open field, and a third was overlooked by a fourth.
It was perhaps three o'clock, and I was growing more and more
faint, when I saw an opening through the trees and the corner of a
house. I approached it slowly. There was a field beyond, but no
houses in sight, and the woods came up to the yard behind. "It is
just the house I need," I said to myself, "and now I must risk it and
go in." I slipped my pistol round, so that I could draw it quickly from
under my coat, and pushed open the gate. All was quiet; I walked
round to the door, and saw a woman inside, who looked startled at
seeing me. She said she would call her husband, who was in the
field, and went out. I watched her, and in a few minutes was
satisfied by seeing them returning. I went back, and narrowly
inspected the house. A shot gun hung over the window, but it was
unloaded and rusted. As I finished, they came in. He was a young
man, with a bright, happy face—far too cheerful a face for a
secessionist. We looked at each other, and he said:
"You are a Union soldier."
"Yes," I answered; "and what are you?"
"I am a Union citizen," he replied.
The word "Union" was something of a talisman; if he had been a
rebel, he would have said Federal.
James Mills (for such was my new-found friend's name) was the first
of several suffering and devoted Union men, who refused all pay and
reward for the services they rendered to me, and whose kindness I
cannot sufficiently praise. He told me I was in a dangerous
neighborhood, and must neither stay, nor travel by the road. His
wife hurried for me a dinner, and then he went with me through
some fields and woods, and placed me upon a path leading to a
second Union man's, named Henry Chunn. It was something like
three miles to Mr. Chunn's, but I felt quite fresh and equal to a
dozen, if necessary.
Arriving there, I was most kindly received by his wife. She told me
that her husband would cheerfully take me on toward Paducah. She
made me lie down; she bathed my shoulder; and she did everything
for me that womanly kindness could suggest. This was the first bed I
had lain upon for more than three months. It produced an old effect,
for in a few moments I was sound asleep. I slept till after dark, and
then awoke by hearing the children cry that father had come. He
came in, and walking up to me, said, in a cordial, honest voice:
"My friend, I am truly glad to see you; you are truly welcome to my
house."
I went to sleep again and slept till morning. There was bad news
then: his mules had disappeared from the barnyard during the night.
But I must wait; his boys would find them by the time we finished
breakfast. At breakfast a little circumstance occurred which may give
you an idea of the different life we lead on the border. Across some
fields, and beyond some woods, we heard a gun. It was no cannon
—a mere shot-gun, such as a boy might fire anywhere on a spring
morning—yet we all stopped talking.
"What does that mean?" I asked, after the silence had continued a
few moments.
"I don't know," said Mr. Chunn.
"Have your neighbors guns and powder?"
"No."
"Then," said I, "it may mean a great deal for us."
We all rose from the table, and looked anxiously across the fields;
but nothing was to be seen. The family looked troubled, and Mr.
Chunn said something about the mules being gone, and this being
strange. We waited some time, but all continued quiet. But the boys
had not found the mules, and Mr. Chunn accordingly walked on with
me toward the house of Mr. Edward Magness, who was likewise a
good Union man, and would willingly help me on.
I took leave of these kind, simple-minded people, whose plain and
honest goodness is rare in the great world, from which they live
apart, and went slowly along the little wood road. I soon came to a
field in which were two or three men and several children, planting
corn. I must here explain to you that in the South corn is the one
great crop on which everybody lives. The bread is all made of corn;
the horses are fed on corn; the pigs are fattened on corn; and if the
corn should fail there would be a famine. There were fears that it
would fail. The spring had been cold and wet, and the planting was
not half done, which always had been over a week before. All hands
were working early and late on every plantation, seizing on this fine
weather for hurrying in the corn. As Mr. Magness came down a
furrow, near me, I stepped out of the bushes, and told him briefly
who I was, and what I wanted. It must have been an unwelcome
tale; yet he never, by a look or word, gave a disagreeable sign.
Promptly he stopped his plough and unhitched his horses.
Unwillingly I saw the planting cease. But when I spoke of it, he said
pleasantly, they would try and make up the lost time when he came
back. We went to his house, the saddles were soon put on, and we
started. My companion was more than usually intelligent, and gave
me much information. He also understood the danger of being seen
by secessionists, and picked his way with great care by unused
roads.
A ride of several miles brought us to the house of Mr. Wade. A very
shrewd and cautious man was Mr. Wade, yet a staunch Union man,
who had spoken, and suffered for the cause. He had spent the
previous eight months chiefly at Paducah, stealing up occasionally in
the dark of evening to see his family, and leaving before daylight the
next morning. Once he had been arrested, and twice his house had
been searched and robbed. He knew well the woods and by-paths,
and had tried the difficulties and dangers of escaping from guerrillas.
He and I, therefore, had much more in common than the others,
and in him I felt I had a trusty and experienced friend; yet strange
to tell, he was—a South Carolinian.
We went into the house. On a couch lay a very aged woman, who, I
thought, was childish. Mr. Wade and Mr. Magness were old friends,
and talked as country neighbors talk, of crops, and roads, and men,
and places. At last Mr. Magness said: "I saw Edward Jones yesterday,
and he told me they had had a letter from Joel, and that he wrote
they were leaving Corinth, and had been attacked. His regiment was
defeated, and he had to run for his life."
The old lady, at this, rose up and said: "Say that over, sir."
Mr. Magness repeated it.
"He is my own grandson," said the old lady. "The night before he
went he came here, and I told him never to fight against his country
—the country his forefathers fought for. He said, 'Grandmother, they
will call me a coward if I don't go.' A coward! I would let them call
me anything, I told him, before I would fight against my country. But
he went. And, now, what do you tell me? He is my own grandson—
my own flesh and blood—so I can't wish him killed," said the old
lady, with great feeling; "but, I thank God—I thank God he has had
to run for his life!"
Our early dinner finished, Mr. Magness took his departure, and we
started.
"We will stop at my brother-in-law's, captain," said Mr. Wade, "and
get you a better saddle. It is only a mile from here." So we rode
quietly along.
"We will pass our member of Assembly," said Mr. Wade. "It is about
a mile from my brother-in-law's. He is a true man, I tell you. The
secesh would give anything to get him."
By this time we reached his brother-in-law's. A little girl was in the
yard, and, as we stopped, came to the gate.
"Well, uncle," said the little girl, "are you running away again from
the rebel soldiers?"
"No," said Mr. Wade, cheerfully, "—oh no: there are no rebels round
now."
"Yes, there are," said the girl. "Father has just come from
Farmington, and there are four hundred there."
"What! four hundred in Farmington!"
"It is so, brother," said a woman who had come out—"it is so. They
came there this morning; and husband hurried back to tell the
neighbors."
"Captain," said Mr. Wade, "the sooner you and I get out of this
country the better for us."
"How far is it back to Farmington?"
"Only four miles."
"Is there any reason for their coming down this road?"
"Yes: Hinckley, the member we elected, lives on it, and Jones, who
helped elect him, lives on it, and I live on it. They would like to
arrest us all. But about half a mile from Hinckley's there is a little
side-path we can take for five or six miles."
Could we have ridden on a gallop, the side-path would have been
reached before the threatening danger could have reached us; but,
unfortunately, the pain in my side had increased so that we could
not go faster than a walk. I tried a trot for a moment, but could not
bear it, and reined up. "Do you ride on, Mr. Wade," I said: "there is
no need of our both being taken." But Mr. Wade refused.
It was an anxious ride. We knew that Farmington was not far
behind, and they might come clattering after us at every moment.
We looked back often—at every turn of the road—from the top of
every knoll and hill, but nothing was seen.
Soon we came to Hinckley's. Two men were seated on the porch,
and the flag was flying in front of the house. I rode on; but Mr.
Wade stopped, and said, "Pull down your flag, boys, and take to the
woods." It was quietly said, but the two men sprang up. I looked
back, and saw them exchange a few words with Mr. Wade, and then
one pulled down the flag as the other ran toward the stable. There
was another anxious interval, and then we reached the side-road.
We went past it, so as to leave no trail, and first one, and then the
other, struck off through the woods until we came to it. A very
intricate and narrow little road it was; so that the enemy could not
have travelled much faster than we. Yet there were some settlers,
"but all good Union men," Mr. Wade said. At the first we stopped;
and he borrowed a butternut coat, and, with some difficulty, helped
me off with my soldier's blouse, and on with it; so that to any person
in a neighboring house or field we must have seemed like two
farmers riding along.
After six or seven miles, our bridle-path came back to the main road.
"There is a nasty, secesh tavern down the road a mile or so," said
Mr. Wade, "and if they are in this part of the country, they will be
sure to go down there for the news and a drink. If we can only get
across the road and over to old Washam's, we shall be safe."
Slowly we came out to the road. We stopped and listened—we held
our breath, and bent down to catch the trampling of their horses.
We moved on where the bushes grew thickest, and stopped again.
Then Mr. Wade rode out and looked up and down. "There is no one
in sight," he said; "come on quickly." I hurried my horse, and in a
moment was across. On the other side were great trees and but little
underbrush to hide us. We hurried on until we were hidden from the
road, and then Mr. Wade drew a long breath, and said: "They won't
come down this road; we are safe now."
The danger past, there came a great increase of pain. Each step of
the horse racked me, and I felt myself grow weaker and weaker. At
last came the refreshing words: "Old Washam's is the next house,"
and soon the next house appeared. "A true Union man," said Mr.
Wade, and true he seemed, for the flag was displayed before the
door. We stopped, but I was too exhausted to dismount, and had to
slide off into Mr. Wade's arms. As I did so, an old lady with silver
spectacles upon her nose and knitting in her hand, came out. "What
is the matter with that poor man?" she cried; and then catching
sight of my uniform under the butternut coat, "Why, it is a Union
soldier; bring him into the house—bring him in immediately." So I
was brought in and laid upon a bed, and tenderly cared for.
I lay there watching the knitting and listening to the old lady and her
daughter's talk. They had a consultation upon my safety, and it was
decided that I should go to the daughter's house for the night. "It is
off the road," they said, "and if they make an attack, we can send
you word across the fields." But later, we learnt that two spies had
passed the house that day, and it was decided I should be sent on
that night.
We were to start from the house of a son-in-law of Mr. Washam's,
and he and his brother-in-law were to drive me. I walked up to the
house, and found the wagon nearly ready. His wife was a young girl,
with a sweet and gentle voice and manner. "It is too bad," she said,
"too bad that you should go away so wounded and wearied. In
peace, we would not let any one leave our home thus." Soon the
wagon came to the door. "Mother," she said, "let us make up a bed
in it."
"Oh, no," I interposed, "I am not used to a bed; I have not had one
in three months, and cannot put you to such trouble."
"It is no trouble to us," she replied, so earnestly and kindly, that I
could not doubt it; "do not think that of us."
"But," I went on, "I assure you, some hay in the wagon is all I want,
and much more than I am accustomed to. Besides, I am dusty and
dirty, and shall certainly spoil your bed clothes."
"If it had not been for you Union soldiers fighting for us," she
answered, "there would be nothing in this house to spoil; and
whatever we have, you shall have."
Against such goodness and patriotism, who could raise objections?
The bed was made in the wagon; they helped me up, and blessed
by many good wishes and kind farewells, we started. For me it was
so much more safe and comfortable than usual, that I soon fell
asleep; but to my two young friends, it was an unusual and an
anxious drive. Frequently I was roused by the wagon stopping.
Sometimes they heard dogs barking—sometimes voices, and once a
gun. At length I woke, to find the wagon standing in front of a
house, and young Washam thumping on the door. Soon a man came
out.
"Why, boys," he said, "what on earth are you doing here this time o'
night?"
"Why you see, Mr. Derringer," said one of the "boys," "here's a
wounded Union officer, hurt in the fight on the Obion. Joel Wade
brought him to our house, and we've brought him here; and now we
want you to take him to Paducah."
"I'm really sorry," said Mr. Derringer, "that I've lent my wagon; but
my neighbor, Purcell, is a good Union man, and he will do it. All of
you come in, and I will go over and see him."
I told Mr. Derringer to wait till morning; but he would not hear of it;
and after seeing us comfortably in bed, he started off to walk a mile
or two and wake his neighbor in the dead of night, to tell him he
must come at break of day and carry on a stranger, of whom he had
never even heard, for no other reason than that he was a wounded
Union officer.
Before daylight, Mr. Derringer roused us. It was all right, he said; his
neighbor Purcell would be there; and now his wife was up, and had
breakfast ready. As breakfast finished, Mr. Purcell arrived; I bade my
good friends good-bye, and started on the last stage of my journey.
As we reached the main road, we saw numbers of men mounted on
jaded mules, and clad in sombre butternut, with sad and anxious
faces. Unhappy refugees flying from the invading foe! Some who
had journeyed through the night, rode with us toward Paducah;
others who had reached it the day before, rode anxiously out in
quest of news. As many caught sight of me, they recognized the
marks of recent service.
"Are you from the Obion?" they asked; "how far off is the enemy
now? Will he dare to come here?"
We drew nearer to the town, and the signs of alarm increased. The
crowd of refugees grew greater—the cavalry patrolled the roads—
the infantry was under arms, and the artillery was planted so as to
sweep the approaches. At last some houses appeared.
"This is Paducah," said Mr. Purcell; "you are there at last."
We stopped at headquarters, and I went in to report.
"Is the adjutant in?" I asked of an officer who was writing.
"I am the adjutant, sir," he answered, without looking up.
"I have come to report myself as arriving at this post."
"What name, sir?"
I gave my name. The adjutant looked up, and with some surprise,
said:
"Why, you are reported killed, sir; two of your men saw you lying
dead under your horse!"
"How many of my men have come in?"
"About half; they are at the Provost Marshal's."
"Any officers?"
"Yes; one of your lieutenants was taken, but escaped, and came
down from Mayfield by railroad. And now," said the adjutant, "don't
stay here any longer; go at once to the hospital, and I will send an
order to the medical director to give you a good surgeon."
A few moments more, and I caught sight of a group of my men.
Then came the painful questions: Who have come in? Who are
missing? Who last saw this one? Who knows anything of that one?
Where does K's family live? and who will write to tell them how he
fell? And then came a surgeon—a quiet room—a tedious time—an
old friend—and a journey home.
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.
ebookball.com