Data Structures and Algorithm Analysis in C 2nd Edition China Reprint Edition Weiss download
Data Structures and Algorithm Analysis in C 2nd Edition China Reprint Edition Weiss download
https://ebookfinal.com/download/data-structures-and-algorithm-
analysis-in-c-2nd-edition-china-reprint-edition-weiss/
https://ebookfinal.com/download/data-structures-and-algorithm-
analysis-in-java-3rd-edition-edition-mark-a-weiss/
https://ebookfinal.com/download/data-structures-and-algorithm-
analysis-in-java-3rd-edition-dr-clifford-a-shaffer/
https://ebookfinal.com/download/fundamentals-of-data-structures-
in-c-2nd-edition-ellis-horowitz/
https://ebookfinal.com/download/adts-data-structures-and-problem-
solving-with-c-2nd-edition-larry-r-nyhoff/
Data structures and algorithms in Java 2nd Edition Adam
Drozdek
https://ebookfinal.com/download/data-structures-and-algorithms-in-
java-2nd-edition-adam-drozdek/
https://ebookfinal.com/download/data-structures-using-c-second-
edition-reema-thareja/
https://ebookfinal.com/download/data-structures-and-other-objects-
using-c-4th-edition-main/
https://ebookfinal.com/download/data-analysis-of-asymmetric-
structures-advanced-approaches-in-computational-statistics-1st-
edition-takayuki-saito/
https://ebookfinal.com/download/c-programming-program-design-
including-data-structures-5th-edition-d-s-malik/
Data Structures and Algorithm Analysis in C 2nd Edition
China Reprint Edition Weiss Digital Instant Download
Author(s): Weiss, Mark A.
ISBN(s): 9787111312802, 7111312805
Edition: 2
File Details: PDF, 114.91 MB
Year: 2010
Language: english
1•
.a
..
2)
Data Structures
and
CCNO
Or T I 0
.Algorithm Analysis in C
&4Jfl3flft C4M! (.
Data Structures and Algorithm Analysis in C (Second Edition)
*WiW5,2Ot3O$tt*#n*ttt—, *I*BL*flJ?nn
fl, fl t*WSNJ?ncJntX*JJ, #JflJW, EWfl5OOfThic
M*#M$tT&hTL IitC#!ifl
W, #flfletjfl.. iüBtTfi4R0
%fflWtTMiI3flR, W—&M
tnTRfl4fluA, IM TTflW treaptL. k-d*t
www.pearsonhighered.com
ISBN 978-7-111-31280-2
WNa4t: (010) 88378991, 88361066
itftMM: [email protected]
9 87111 312802
1J9I4t: www.chlna-pub.com
-4* P44 ffh 45.OOYE
()& 2j)
II:!
II# I
liii
‘lit
! ‘i )z Jq
I *
I I
I I I
I
II I I 11
A
English reprint edition copyright © 2010 by Pearson Education Asia Limited
and China Machine Press.
Original English language title: Data Structures and Algorithm Analysis in C,
Second Edition (ISBN 978-0-201-49840-0) by Mark Allen Weiss, Copyright © 1997.
All rights reserved.
Published by arrangement with the original publisher, Pearson Education, Inc.,
publishing as Addison-Wesley.
For sale and distribution in the People’s Republic of China exclusively (except
Taiwan, Hong Kong SAR and Macau SAR).
$wpn, ft:vtR
*1*ItJiM
: 01-2010-4175
*4€:
(CIP) fl
l50mmx2l4mm l6.5EFJ*
ISBN 978-7-111-31280-2
tift: 45.005
, &&-flfl. A*2J°
4WIS$flfli 3b&ftfl”. 1998
U
Peterson*—4fttAfi,
Ilk, flflTh IU+&*L *JJW NT)SAk
L
“t±flf4flt” kIt #JT 34flj4ffiJjfl, N
fl4ZflTrtWflfl, JtflTa1Iiflnfl
iv
If
j+, “i4”
Tt
, #iE
“I1n
11TfliJE0
ft, WtJL*I
iUfl
Ijni
1flI±IE, i9fl1:
*: www.hzbook.com
(010) 88379604
J4hj1:
100037
PREFACE
Purpose/Goals
This book describes data structures, methods of organizing large amounts of data,
and algorithm analysis, the estimation of the running time of algorithms. As computers
become faster and faster, the need for programs that can handle large amounts
of input becomes more acute. Paradoxically, this requires more careful attention to
efficiency, since inefficiencies in programs become most obvious when input sizes are
large. By analyzing an algorithm before it is actually coded, students can decide if a
particular solution will be feasible. For example, in this text students look at specific
problems and see how careful implementations can reduce the time constraint for
large amounts of data from 16 years to less than a second. Therefore, no algorithm
or data structure is
presented without an explanation of its running time. In some
cases, minute details that affect the running time of the implementation are explored.
Once a solution method is determined, a program must still be written. As
computers have become more
powerful, the problems they must solve have become
larger and more complex, requiring development of more intricate programs. The
goal of this text is to teach students good programming and algorithm analysis skills
simultaneously so that they can develop such programs with the maximum amount
of efficiency.
This book is suitable for either an advanced data structures (CS7) course or
Approach
I believe it is important for students
to learn how to program for themselves, not
discuss realistic programming issues without including sample code. For this reason,
the book usually provides about one-half to three-quarters of an implementation,
and the student is encouraged to supply the rest. Chapter 12, which is new to this
edition, discusses additional data structures with an emphasis on implementation
details.
vi Preface
The algorithms in this book are presented in ANSI C, which, despite some
flaws, is arguably the most popular systems programming language. The use of C
instead of Pascal allows the use of dynamically allocated arrays (see, for instance,
rehashing in Chapter 5). It also produces simplified code in several places, usually
because the and (&&) operation is short-circuited.
Most criticisms of C center on the fact that it is easy to write code that is barely
readable. Some of the more standard tricks, such as the simultaneous assignment
and testing against 0 via
if (x=y)
aregenerally not used in the text, since the loss of clarity is compensated by only a
few keystrokes and no increased speed. I believe that this book demonstrates that
unreadable code can be avoided by exercising reasonable care.
Overview
Chapter 1 contains review material on discrete math and recursion. I believe the only
way to be comfortable with recursion is to see good uses over and over. Therefore,
recursion is prevalent in this text, with examples in every chapter except Chapter 5.
Chapter 2 deals with algorithm analysis. This chapter explains asymptotic analysis
and its major weaknesses. Many examples are provided, including an in-depth
explanation of logarithmic running time. Simple recursive programs are analyzed
by intuitively converting them into iterative programs. More complicated divide-
and-conquer programs are introduced, but some of the analysis (solving recurrence
relations) is implicitly delayed until Chapter 7, where it is performed in detail.
Chapter 3 covers lists, stacks, and queues. The emphasis here is on coding
these data structures using ADT5, fast implementation of these data structures, and
an exposition of some of their uses. There are almost no programs (just routines),
but the exercises contain plenty of ideas for programming assignments.
Chapter 4 covers trees, with an emphasis on search trees, including external
search trees (B-trees). The uix file system and expression trees are used as examples.
AVL trees and splay trees are introduced but not analyzed. Seventy-five percent of the
code is written, leaving similar cases to be completed by the student. More careful
treatment of search tree implementation details is found in Chapter 12. Additional
coverage of trees, such as file compression and game trees, is deferred until Chapter
10. Data structures for an external medium are considered as the final topic in
severalchapters.
Chapter 5 is a relatively short chapter concerning hash tables. Some analysis is
performed, and extendible hashing is covered at the end of the chapter.
Chapter 6 is about priority queues. Binary heaps are covered, and there is
additional material on some of the theoretically interesting implementations of
priority queues. The Fbonacci heap is discussed in Chapter 11, and the pairing heap
is discussed in Chapter 12.
Preface vii
Chapter 7 covers sorting. It is very specific with respect to coding details and
analysis. All the important general-purpose sorting algorithms are covered and
compared. Four algorithms are analyzed in detail: insertion sort, Sheilsort, heapsort,
and quicksort. The analysis of the average-case running time of heapsort is new to
this edition. External sorting is covered at the end of the chapter.
Chapter 8 discusses the disjoint set algorithm with proof of the running time.
This is a short and specific chapter that can be skipped if Kruskal’s algorithm is not
discussed.
Chapter 9 covers graph algorithms. Algorithms on graphs are interesting, not
only because they frequently occur in practice but also because their running time is
so heavily dependent on the proper use of data structures. Virtually all of the standard
algorithms are presented along with appropriate data structures, pseudocode, and
analysis of running time. To place these problems in a proper context, a short
discussion on complexity theory (including NP-completeness and undecidability) is
provided.
Chapter 10 covers algorithm design by examining common problem-solving
techniques. This chapter is heavily fortified with examples. Pseudocode is used in
these later chapters so that the student’s appreciation of an example algorithm is not
obscured by implementation details.
Chapter 11 deals with amortized analysis. Three data structures from Chapters
4 and 6 and the Fibonacci heap, introduced in this chapter, are analyzed.
Chapter 12 is new to this edition. It covers search tree algorithms, the k-d tree,
and the pairing heap. This chapter departs from the rest of the text by providing
complete and careful implementations for the search trees and pairing heap. The
material is structured so that the instructor can integrate sections into discussions
from other chapters. For example, the top-down red black tree in Chapter 12 can
be discussed under AVL trees (in Chapter 4).
Chapters 1—9
provide enough material for most one-semester data structures
Exercises
Exercises, provided at the end of each chapter, match the order in which material
is presented. The last exercises may address the chapter as a whole rather than a
specific section. Difficult exercises are marked with an asterisk, and more challenging
exercises have two asterisks.
A solutions manual containing solutions to almost all the exercises is available
to instructors from the Addison-Wesley Publishing Company.
viii Preface
References
References are placed at the end of each chapter. Generally the references either
are historical, representing the original source of the material, or they represent
extensions and improvements to the results given in the text. Some references
represent solutions to exercises.
Code Availability
The program code in this book is available via anonymous ftp
example
at is also accessible through the World Wide Web; the URL is
aw.coni. It
Acknowledgments
Many, many people have helped me in the preparation of books in this series. Some
are listed in other versions of the book; thanks to all.
For this edition, I would like to thank my editors at Addison-Wesley, Carter
Shanklin and Susan Hartman. Ten Hyde did another wonderful job with the
production, and Matthew Harris and his staff at Publication Services did their usual
fine work putting the final pieces together.
M.A. W.
Miami, Florida
1996
July,
CONTENTS
Introduction 1
1.1. What’stheBookAbout? 1
Sununary 12
Exercises 12
References 13
2 Algorithm Analysis 15
2.1. Mathematical Background 15
2.2. Model 18
2.3. WhattoAnalyze 18
2.4. Running Time Calculations 20
2.4.1. ASimpleExample 21
2.4.2. GeneraiRules 21
2.4.3. Solutions for the Maximum Subsequence Sum Problem 24
2.4.4. Logarithms in the Running Time 28
2.4.5. CheckingYourAnalysis 33
2.4.6. A Grain of Salt 33
Summary 34
Exercises 35
References 39
x Contents
4 Trees 89
4.1. Preliminaries 89
4.1.1. Implementation of Trees 90
4.1.2. TreeTraversalswithanApplication 91
4.2. BinaryTrees 95
4.2.1. Implementation 96
4.2.2. Expression Trees 97
5 Hashing 149
5.1. General Idea 149
5.2. Hash Function 150
5.3. Separate Chaining 152
5.4. Open Addressing 157
5.4.1. linear Probing 157
5.4.2. QuadratIc Probing 160
5.4.3. Double Hashing 164
5.5. Rehashing 165
5.6. Extendible Hashing 168
Summary 171
ExercIses 172
References 175
Summary 212
Exercises 212
References 216
7 Sorting 219
7.1. Preliminaries 219
7.2. Insertion Sort 220
7.2.1. The Algorithm 220
7.2.2. AnalysisoflnsertionSort 221
Summary 337
Exercises 337
References 343
Index 501
CHAPTER 1
Introduction
In this chapter, we discuss the aims and goals of this text and briefly review
programming concepts and discrete mathematics. We will
See that how a program performs for reasonably large input is just as important
as itsperformance on moderate amounts of input.
Summarize the basic mathematical background needed for the rest of the
book.
Suppose you have a group of N numbers and would like to determine the kth largest.
This is known the selection problem. Most students who have had aprogramming
as
course or two would have no difficulty writing a program to solve this problem.
There are quite a few “obvious”solutions.
One way to solve this problem would be to read the N numbers into an array,
sort the array in decreasing order by some simple algorithm such as bubblesort, and
then return the element in position k.
A somewhat better algorithm might be to read the first k elements into an array
and sort them (in decreasing order). Next, each remaining element is read one by
one. As a new element arrives, it is
ignored if it is smaller than the kth element
in the array. Otherwise, it is placed in its correct spot in the array, bumping one
element out of the array. When the algorithm ends, the element in the kth position
is returned as the answer.
Both algorithms are simple to code, and you are encouraged to do so. The
natural questions, then, are which is better and, more important, is either
algorithm
algorithm good enough? A simulation using a random file of 1 million elements
and k =
500,000 will show that neither algorithm finishes in a reasonable amount
they cannot be considered good algorithms, because they are entirely impractical for
input sizes that a third algorithm can handle in a reasonable amount of time.
A second problem is to solve a popular word puzzle. The input consists of a
two-dimensional array of letters and a list of words. The object is to find the words
in the puzzle. These words may be horizontal, vertical, or diagonal in any direction.
As an example, the puzzle shown in Figure 1.1 contains the words this, two, fat,
and that. The word this begins at 1, column 1, or (1,1), and extends to (1,4);
row
two goes from (1,1) to (3,1); fat goes from (4,1) to (2,3); and that goes from (4,4)
to (1,1).
Again, there are at least two straightforward algorithms that solve the problem.
For each word in the word list, we check each ordered
triple (row, column,
orientation) for the presence of the word. This amounts to lots of nested for loops
but is basically straightforward.
Alternatively, for each ordered quadruple (row, column, orientatton, number
of characters) that doesn’t run off an end of the puzzle, we can test whether the
word indicated is in the word list. Again, this amounts to lots of nested for loops. It
is possible to save some time if the maximum number of characters in any word is
known.
It is relatively easy ro code up either method of solution and solve many of the
real-life puzzles commonly published in magazines. These typically have 16 rows, 16
columns, and 40 or so words. Suppose, however, we consider the variation where
only the puzzle board is given and the word list is essentially an English dictionary.
Both of the solutions proposed require considerable time to solve this problem and
therefore are not acceptable. However, it is possible, even with a large word list, to
solve the problem in a matter of seconds.
An important concept is that, in many problems, writing a working program is
not good enough. If the program is to be run on a large data set, then the running
time becomes an issue. Throughout this book we will see how to estimate the
running time of a program for large inputs and, more important, how to compare
the running times of two programs without actually coding them. We will see
techniques for drastically improving the speed of a program and for determining
program bottlenecks. These techniques will enable us to find the section of the code
on which to concentrate our optimization efforts.
1 2 3 4
1 t h i s
2 w a t s
3 o a h g
4 1 g d t
Chapter 1 Introduction 3
This section lists some of the basic formulas you need to memorize or be able to
1.2.1. Exponents
XAXB =
XAt8
yA
-
XAB
XB
(XA)B =
XAB
+ XN =
2XN X2”
2’ + 2N’ 2N+1
1.2.2. Logarithms
In computer science, all logarithms are to the base 2 unless specified otherwise.
DEFINmON: XA =
B if and only if logy B =
A
ThEOREM 1.1.
logc B
logB= ; C>O
Iog A
PROOF:
Let X loge B, Y
=
loge A, and Z log B. Then, by the definition of
= =
logarithms, C B, C A, and AZ
=
B. Combining these three equalities
= =
yields (C Cx B. Therefore, X
=
YZ, which implies Z X/Y,
= =
ThEOREM 1.2.
logAB =
logA + logB
PROOF:
Let X =
log A, Y =
log B, and Z =
logAB. Then, assuming the default base
of 2, 2X =
A, 2’ =
B, and 2Z =
AB. Combining the last three equalities yields
= =
AB. Therefore, X + Y =
Z, which proves the theorem.
Some other useful formulas, which can all be derived in a similar manner,
follow.
Discovering Diverse Content Through
Random Scribd Documents
jest like makin’ fun o’ a gal, an’ we didn’ hev the heart. So we jest give
him the nickname ‘Bub’ and tuk him in.
“He was ’bout twenty-two year, but he didn’ look sixteen. That boy
could work, tho’—and l’arn?—l’arned quicker’n lightin’. ’Twarn’t
mor’n two days till he had off his store togs and borryed a pair o’
overalls. An’ he was so happy-like an’ joyous, singin’ ’round all day
like a canary in a cage.
“Seems like luck was ag’in’ him from the first, tho’. Nothin’ he
teched turned out right. Thet boy would give up a claim he’d bin
workin’ fur months, with never a sign o’ color, when ’long would
come some feller the very nex’ day and strike it rich with one turn o’
the shovel. Yes, Bub was allus jest one shovel o’ dirt away from
vict’ry.
“He didn’ ’pear to mind, tho’—not as long as Joe Bascom rode up
ev’ry month or so with the mails and brung him one o’ them big fat
envelopes writ on baby-blue paper. Bub used to walk down the road,
sometimes five mile, t’ meet Joe—he was that anxious to git that
letter. We all knew ’twas a gal, and used to josh him ’bout it, but I
didn’ guess how serious ’twas till he come to me one day an’ said:
“‘Peter, I’ve got to strike it soon, and I’ve got to strike it rich.’
“‘Wal,’ I answered, ‘this is one deal where yer cain’t stack the
cards. If you got luck, you’ll hit it, and if you ’ain’t, you won’t.’
“‘But I must hit it, you see. He was more serious ’en I’d ever seen
him. ‘Fact of the matter is, Peter, I’m in love, and she won’t marry me
till I can show her twenty thousand dollars.’
“‘Whew!’ I says. Then to cheer him up: ‘Bub, don’ be scared; if she
loves you she’ll take you without a cent.’
“‘Maybe, Peter, maybe, but that’s the sum she named, and I’m a-
goin’ to git it.’
“He was allus that way after a talk—seemed to raise his sperits.
“Long ’bout spring things changed. He come in a whoopin’ one
even’ ’bout sunset, and nearly turned the camp upside down. He’d
struck it at last. Not much, but gold—real gold—and in this game you
never kin tell what’s layin’ jest ’round th’ corner.
“A few months later he come to me agin.
“‘Peter,’ he says, ‘my pile’s gittin’ big. It ain’t gonna be so very long
till I have twenty thousand, and I want you to promise me this. When
I leave I ain’t gonna say good-by to no one, but I’m goin’ to slip you
somethin’ for a celebration, and I want you and the boys to have the
rousingist farewell party this camp has ever seen—after I’m gone.’
“Not long from that a trader come into camp—the kind that carries
’round all sorts o’ dam’-fool trinkets and changes ’em fer ’most
ennythin’—nuggets, dust, er even skins and hides. ’Mong his pack
was a passel tied up in newspaper. We all grabbed fur it at onct, then
decided we’d play cards fur it—not fur what was inside, understan,’
but ev’ry feller wanted to git the first chanct at that thar newspaper.
“Bub won it. We lost heart in playin’ against him when we seen
how anxious he was.
“He tuk it and begun readin’ us the diff’runt items of int’rust,
laugin’ and commentin’ in between—when all of a sudden his eye lit
on somethin’. I never seen enny human bein’ change so in the same
len’th of time. He jest stared—seemed to be readin’ it over and over
ag’in.
“After what ’peared to be a half hour, but I guess was ’bout five
minutes, he looked up—an’ when we saw his face he had changed
from a boy to a old man.
“We was standin’ quiet, not darin’ to ask what happened. Most of
us thought his folks was dead. But then he threw that paper down on
the ground and laughed—the kind o’ laugh as I could believe the
devil would give ye if ye was goin’ down to hell. Then we knew
’twarnt no act o’ God had upset him, but some dam’ trick that could
only be thought out by a human bein’.
“That was the last we saw o’ him. He went off into the woods. Joe
picked up the paper and said he couldn’t find ennythin’ on thet page
to disturb a body—mostly women’s fashions and one piece ’bout a gal
elopin’ with a feller. I didn’ say nothin’, but I guessed it. That gal had
sent him up to the mines to git a fortune and then gone and chucked
him.
“We was all nervous at supper ’cause Bub didn’ come in, and ’long
’bout ten we set out to look fur him. The woods is dark at night, an’
we couldn’t find a trace till Joe, searchin’ up at Bub’s claim, come on
that thar bowlder you seen to-day, and, curious to say, he stumbled
over somethin’ same as you done, but ’twarn’t no pickax head—’twar
a human bootleg. Puttin’ his lantern down low, he seen Bub’s foot a-
stickin’ out from under that rock, and the whole plumb thing had let
down and flattened the life out o’ him.
“’Twas a long time afore I went up to examine the place, and when
I did thar was nothin’ to see but I figgered it out fur myself, and this
is how it must ’a’ bin.
“Bub had most likely bin diggin’ under the rock and gitting out the
pay dirt, and when he’d git so fur in he’d put in a plug to shore up the
thing and keep it from fallin’. That day when he read that paper and
he felt the whole world crumblin’ ’round his head, he jest made it
literal by goin’ up to his claim, crawlin’ under the stone, and kickin’
out the plugs.”
There was a pause.
Peter rose; cutting a piece of the roasting brisket, he started for his
bunk, but stopped before climbing in.
“That’s why I ast you if you turned over the stone—but I hoped you
didn’t.”
Scott had been fifteen years in the woods and wanted to settle
down, saying he would like to see some little Scotts running around.
So when the summer camp broke up he looked about for a location.
He found a log house that had been built by a man named Carrick,
who was hated in the community, principally because he held
mortgages on nearly all the farms for twenty miles around. Carrick
did not have a right to this particular homestead, as he did not live
on it, so Scott went in and jumped the property.
Knowing Carrick would try to use the land, Scott was ready for
him, and when he tried to put his sheep in, Scott, who was waiting in
a hole in the ground, rose with his gun in his hands, saying:
“Don’t touch them bars!”
Like all crooks, Carrick was a coward at heart, and, instead of
settling in the usual way of this part of the country—as man to man—
he took Scott into court. With no money in back of him, Scott won
his case, his extreme honesty and simplicity impressing the judge.
For instance, I remember there was a question as to whether he was
an American citizen or no, and he answered:
“Wal, Jedge, the first thing I remember is livin’ in a town about a
half a mile over the border into Canada, but my mother allus said I
was born in a little red house that we could see across the line, an’ I
took her word for it.”
And so did the court.
I had left Scott and Peter Klink and had gone back to Sissons,
when one morning a man we called “the Texan” came racing down
the town’s one street on horseback, yelling:
“Scott’s shot! Scott’s shot!”
Scott had been beloved of all, and everyone was aroused. It was
quite awhile before we could get the story out of the Texan, but it
finally came to this. He had come across a wagon standing all alone
on the road, filled with the groceries Scott had bought in Yreka. It
was turned around, with the horses facing downhill, the whole
weight of the wagon bearing upon them. They were nosing toward
home and evidently had been there all night, as they were covered
with snow. Looking about, the Texan had seen a trail into the bushes
and, going in a half mile or more, he found Scott’s body. There was a
rope around the neck and he had been dragged into the woods.
The memory came to me of one night when I was camping with
Scott. The conversation had turned on death.
“How would you like to die?” I asked him.
“Shot in the back and never know who done it,” was his quick
answer.
Scott had had his wish.
Death meant nothing to these men. It was all in the day’s
happenings, but to me, at this very moment of writing, visualization
of Scott’s body, as it lay on the rough pine bed in a back room in
Sisson’s Hotel, is as clear as it was in 1877. The rope had been taken
from his neck and had left an impress, above which rose his purple
head, looking like an eggplant, with the shock of red hair, the pale
blue eyes wide open, and the rows of perfect teeth showing, his
mouth drawn into a snarl. His body was green-white, the blood
having all gone to the head, and under the left arm, where the bullet
had gone in, was a little blue spot. But under the right arm, where the
bullet had come out, was a ghastly hole through which protruded
torn pieces of flesh. I did not know that men died that way.
A few minutes after the body was brought in a woodsman was
found who had passed the wagon—it must have been while the
murderer was disposing of the body in the bushes—for he said that a
Ballard rifle was leaning against the wheels. He had thought the
driver of the wagon was off in the woods and would be back
presently, so was in no way surprised at the sight.
The minute the woodsman mentioned the gun I was convinced as
to who had committed the murder. I had seen Carrick’s Indian with a
Ballard rifle. It had a broken extractor, and he had to use a withe to
poke out the empty shell. Sure enough, beside the road we found a
withe covered with powder. An Indian tracker told us, from his
examination of the trees, that the murderer had worn a red tippet
and was riding a sorrel horse with a white star. The evidence was
conclusive enough for us to start out for Carrick’s ranch.
We were a posse of four—the Texan, who had been in the Civil War
and was a real leader; Joe Johnston, a friend of Scott’s; one of Joe’s
hired men; and myself. We were prepared for a fight, for, as Carrick
hated Scott and was probably implicated in the affair, we figured he
would protect the Indian.
The way lay over fertile, grassy country, and on the road we passed
bands of sheep and cattle. One herder rode several miles with us and,
on hearing our errand, said:
“If you help me git these cattle together I’ll tell you something I
know.”
It seems that the night before he had been at Carrick’s house. It
was getting quite late when he heard a mysterious whistle under the
window. Making an excuse, he went outside and looked about. There
in the corral was a horse—sorrel in color with a white star on its
forehead—evidently just returned from a hard run, as it was covered
with lather. At that moment he heard a sound, and coming out of the
kitchen door was Carrick’s son, carrying something in his hand. He
disappeared into the barn. Creeping up to a crack in the building
where a light shone out, he peeped through and saw the boy giving
food to an Indian.
Our evidence was piling up.
Along toward sunset we rode up to Carrick’s place. The sheep
ranch extended for many acres to the north, while the house, barn,
and corral were on the banks of a low willow creek. Carrick was
sitting on a bench out in front. Going directly up to him, the Texan
said:
“Scott’s bin killed—shot.”
“The hell you say!”
“We think your Injin Jim done it.”
He pretended great anger.
“Well, if he did, ketch him and string him up for it. He’ll be back in
a little while.”
We waited.
It was not long until several horsemen appeared and rode up to the
gate. Joe Johnston’s hired man, who was a fool and easily excited,
marched up to Injin Jim and said:
“We’re here to arrest you.”
I have seen a prestidigitator work the most astonishing
disappearances of material things, but I never saw a human being
take himself off into space as quickly as this one did. Jim gave one
flick and was flying into the woods. I was off and under my horse in
an instant, but my pistol missed fire. He had disappeared into the
willow creek, which was overgrown with grass, with here and there
patches of water covering treacherous quicksand. Our only hope was
to close round him and ride him out.
I was in a bad way. My horse had poll evil, and my pistol would not
shoot without the use of an oaken plug. I had seen Jim kill rabbits on
the run many a time, and, adding this to my grief at my friend Scott’s
death, I was working up a great case of true tenderfoot fright. I was
so scared that I would not have recognized Jim if I had seen him, but
I kept on. Finally, the Texan saw that I was rattled and stopped and
drew me behind the others. To think of anyone noticing my
condition drew the tears of mortification to my eyes.
“Go up the hill,” he said, handing me a Winchester, “and watch
and see that Jim does not leave the valley.”
This was a diversion, and I was certainly glad to get away from the
others. I must have stayed up there several hours, and all the time
the hunt was going on there was an accompaniment of wails from
women and children of the Indian camp near by. They would moan
and cry to an even rhythm, and then all of a sudden there would be a
pause. The silence was extraordinary.
At last the Texan called me to come down from my vantage point.
Jim had sent a deputation of squaws to say that he would give
himself up if we would promise not to lynch him. An Indian is afraid
of hanging only because he believes—as the Greeks did—in the
Animus. The breath is the soul, and he will never get to the happy
hunting grounds if he is killed by cutting it off.
We accepted his surrender and began the journey to Johnston’s.
Jim’s legs were tied under his horse, and I can see the procession
now, the Western sun hitting them as they rode on ahead of me. The
smell of sweat, saddle leather, and alkali comes back to me as
pungent as if it were yesterday. The two Carricks seemed to be loath
to leave us, and the old man kept crying repeatedly:
“There is a good hill. Hang him now. What is the use of waiting?
Hang him to onct.”
He tried to be jocular, but he overdid it. He was talking too much.
I, being the scribe, was delegated to take down Jim’s confession.
His hands were tied and lying listless on the table while I rolled him
cigarette after cigarette. In a corner of the room sat his sister, who
was a girl of the town, lolling back on a cot and looking over the
whole scene with a contemptuous curl to her lips. Jim told his story
with the utmost composure. It was no more to him than killing a
deer. He was a chief of his tribe and had been educated, but the
seventy-five dollars and a horse which Carrick had given him to
commit the murder were more than he could withstand.
He told how he had sneaked up behind Scott, shot him, and, taking
his own boots off, ran away. Gaining courage after a while, he crept
back. “He wasn’t bawlin’ no more,” so he took the trace from the
harness and dragged the body into the woods. All this time the boys
were outside, making ready for the hanging—it was impossible to
keep him from them—so I was truly relieved when I heard the loud
beat of horse hoofs and a deputy sheriff arrived on the scene, saying:
“Christ! I’m too soon!”
A party of us went out to Carrick’s that night. There was a white
blanket of snow gleaming in the moonlight. We formed a cordon
around the house while the sheriff went up to the front door. There
was a wild scream when Mrs. Carrick opened it. She had sensed our
errand.
In a little hotel away up in the redwoods, many miles off, the father
and son were taken next morning before dawn. They had stopped, in
their flight, to have breakfast when the sheriff came up to them.
I did not see the trial, as I had left California before it came off, but
the papers stated that Carrick and the Indian were hanged and the
son was sentenced to twenty years. Over the grave of Scott, however,
who had been my bunkmate and friend, I placed a headstone, the
naïvete of which I am afraid I was unaware at the time. In 1915 I was
told by a woman I met in California that in her early childhood up at
Sissons, she used to sit for half a day at a stretch and wonder what it
could mean, this piece of redwood, carved with the words:
Walter Scott [date, etc.]
MURDERED!!! R.I.P.!!!
Certain types thrive on rough life, and others deteriorate. They
might be likened to iron and steel. The true frontiersman is like the
common iron as it is dug from the ground. His feelings and
sensibilities have never been refined; therefore, contact with the
elemental things of life has no debasing effect upon him. The
educated person is more like steel—something produced by being
subjected to a great heat and which must be tempered to the climate.
Hard steel breaks at a low temperature; so does human intelligence
break under rough handling. Place a gentleman back in the primitive
life and he is pretty sure to become a squaw man or a crook; only a
person of refinement has the will and cleverness to be criminal.
I was getting scared. The murder of Scott had given me a jolt and I
decided I had had enough of California. I had been playing poker
every night until I owed the Chinese cook so much money that I had
to sleep with him for two months and let him collect my pay. I
thought this was about as low as I cared to go; so, picking up my
traps one day, I started for San Francisco—and home.
A third-class ticket was sixty-five dollars—we called it the
“emigrant train.” Peddlers sold pieces of canvas and straw mattresses
at the station, and these we stretched across the seats in such a way
as to make a fairly comfortable bed. The rule was that if sixty people
got together they could go through as a “car” and be a law unto
themselves. So we “fired out” the married men, the women, and the
children, and made up our own crowd. We had neglected to get the
full number, however, so the authorities put in twelve Chinamen,
and I remember sleeping with my feet against the bald head of one
all during the trip.
It had taken me seven days to get out West, but the trip back was
thirteen. We were never certain where our car was to be from day to
day. A freight train would come along and we would be hitched to it,
jogging along slowly, only to be dropped at some God-forsaken flag
station, with no way of knowing how long we were to wait. Then, of a
sudden, would come on the express, whisk us up and whirl us along
for several hundred miles.
At every stop a line of boys and girls passed through the car with
cans of fresh milk, pies, cakes, etc., and, augmented by a basket I had
brought from San Francisco, my food cost me only ten dollars for the
whole trip. A passenger was rude to one of these children, knocking
him over and spilling all of his milk. We promptly put him out of our
car, back with the women and children.
We were a motley crowd—all nationalities. There was the usual
“bad man from Texas.” He talked loud, swaggered, and bluffed, and
kept the car in a general uproar. His food for the trip—as far as we
could see—consisted of several feet of bologna sausage which he had
hung from the rack above his seat. When he deemed it time to eat, he
would take out his vicious-looking knife and “hit it a lick.” However
long or short the slice, he would eat it, saying:
“The Texan only eats what he can get by the might of his right
arm.”
Every once in a while his “might” would get beyond all control and
he would knock a hunk of the sausage in among the crowd of poor
chattering Chinamen, frightening them almost out of their senses.
Then, to make matters worse, he would dive for it with his
dangerous-looking knife. I used to argue with him about this action
until the bald-headed Chinaman in the seat in front of me knew I
had saved his life. Every morning a pot of tea, made hot by the stove
at the end of the car, was on the floor beside my bunk.
It was the Texan who told the other men not to play poker with
me, as my hands were “too soft” and I must be a card sharp. When I
accosted him with it he only said, “Well, how did you get those
hands?” and was much amused when I answered, “Painting
pictures.”
We never left the train that we did not encounter some strange
adventure. At one station, in a shed for horses, we saw the body of a
negro with sixteen bullet holes in it, a sight that would have been
carefully guarded from the eyes of first-class passengers. At Ogden
City we bribed the trainman to tell us that we would have several
hours to spare. There was a camp of seventy-five tramps on the
border of the lake, and their antics had been terrorizing the citizens.
These men of the road accepted us as bosom companions, told us
stories, and finally fed us a wonderful dinner of chicken and all sorts
of delicacies, cordially inviting us to join them permanently.
Instead of being a bore, the trip was one of the most delightful I
ever made and, except for one small aftermath, marked the closing of
a definite chapter in my life. I had been back only a short time when I
was walking along Howard Street in Boston, my thoughts everywhere
but out West. Noticing a crowd in front of a house, I drew up to see
the excitement. It was nothing unusual for those days—a gang of
toughs were wrecking a Chinese laundry. Standing at the door,
uttering most horrible sounds and brandishing an ax in his hand,
was an old Chinaman. Just then he saw me, stopped yelling, dropped
his ax, and, to the astonishment of all, fell on my neck. All Chinamen
looked alike to me, but there could be no doubt about it—it was my
friend of the emigrant train. Of course I appealed to the police and
the toughs were dispersed; but I had an awful time explaining to this
frightened Oriental that I was not his savior.
Chapter V: Adventures in Æstheticism
Paris and Student Days
We are fond of saying that things are not the same as they were
when we were young, but I fear we are wrong. The change is in
ourselves. When I went back to Paris in 18—— I visited some of the
old familiar haunts. One was the little café, where I used to breakfast
every morning when a student. Everything looked the same—the
dingy walls, dirty floor, but spotless tables—as the French tables
always are; the waiters calling out the orders for their well-known
patrons as soon as they showed their faces in the doorway; the poor,
half-starved grisettes eating their sou’s worth of bread—I could
hardly believe I had been away for so many years.
But why did the food taste so strange? The croissons were soggy,
and the coffee, with its abominable taste of chicory—bah! Was it
possible I could once have lived on this fare and actually liked it? I
could not even call back one old thrill.
After such a disappointment, I was almost afraid to visit Julian’s,
but with rather a sinking heart I turned into the Passage de
Panorama, around the corner to the galerie, up the still dirty
stairway, and opened the door. Instantly I was greeted with French
oaths and comments, and I found myself running a barricade of
paint tubes and what seemed to me all the furniture in the room,
hurled at my head. I stopped and swore in every language I knew,
crying:
“If anyone here is as old an ancien as I, I’ll kneel to him, but if not,
get down on your knees, the whole crowd of you!”
“Who are you?” they asked.
I pointed to the wall where hung a drawing—the very one which
had won me the hundred francs in the contest. Instantly everyone in
the room was on his knees.
The tears streamed down my cheeks; I was not disappointed. My
old Paris had come back to me!
Chapter VI: The Middle Ages
Brittany; Spain
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.
ebookfinal.com