100% found this document useful (1 vote)
72 views

Data Structures and Algorithm Analysis in C 2nd Edition China Reprint Edition Weiss download

The document provides a link to download the 'Data Structures and Algorithm Analysis in C, 2nd Edition' by Mark A. Weiss, along with several other related textbooks. It outlines the book's purpose, which is to teach data structures, algorithm analysis, and efficient programming techniques. The content includes a comprehensive overview of various data structures, algorithms, and their implementations in C, emphasizing the importance of efficiency in handling large data sets.

Uploaded by

koksigman
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
72 views

Data Structures and Algorithm Analysis in C 2nd Edition China Reprint Edition Weiss download

The document provides a link to download the 'Data Structures and Algorithm Analysis in C, 2nd Edition' by Mark A. Weiss, along with several other related textbooks. It outlines the book's purpose, which is to teach data structures, algorithm analysis, and efficient programming techniques. The content includes a comprehensive overview of various data structures, algorithms, and their implementations in C, emphasizing the importance of efficiency in handling large data sets.

Uploaded by

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

Data Structures and Algorithm Analysis in C 2nd

Edition China Reprint Edition Weiss pdf download

https://ebookfinal.com/download/data-structures-and-algorithm-
analysis-in-c-2nd-edition-china-reprint-edition-weiss/

Explore and download more ebooks or textbooks


at ebookfinal.com
Here are some recommended products for you. Click the link to
download, or explore more at ebookfinal

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-edition-mark-a-weiss/

Data Structures and Algorithm Analysis in Java 3rd Edition


Dr. Clifford A. Shaffer

https://ebookfinal.com/download/data-structures-and-algorithm-
analysis-in-java-3rd-edition-dr-clifford-a-shaffer/

Fundamentals of Data Structures in C 2nd Edition Ellis


Horowitz

https://ebookfinal.com/download/fundamentals-of-data-structures-
in-c-2nd-edition-ellis-horowitz/

ADTs Data Structures and Problem Solving with C 2nd


Edition Larry R. Nyhoff

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/

Data structures using C Second Edition Reema Thareja

https://ebookfinal.com/download/data-structures-using-c-second-
edition-reema-thareja/

Data Structures and Other Objects Using C 4th Edition Main

https://ebookfinal.com/download/data-structures-and-other-objects-
using-c-4th-edition-main/

Data Analysis of Asymmetric Structures Advanced Approaches


in Computational Statistics 1st Edition Takayuki Saito

https://ebookfinal.com/download/data-analysis-of-asymmetric-
structures-advanced-approaches-in-computational-statistics-1st-
edition-takayuki-saito/

C Programming Program Design Including Data Structures 5th


Edition D. S. Malik

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

flWtTfl&it’5, mnn 31*W*. wu. SLfl


no
#Tfl#1D *flIflMg, znflBPit. IL z’jk.nfl

%fflWtTMiI3flR, W—&M
tnTRfl4fluA, IM TTflW treaptL. k-d*t

Mark Alien Weiss 1987fl YIP


AtRobert Sedgewick, W *itE-54tL 1
@tAP(Advanced Placement) 4JU*4MtSJ*O tflWI
&a fln4fl0

www.pearsonhighered.com

For sale and distribution in the People’s Republic of china


exclusively (except Taiwan, Hong Kong SAR and Macau SAR).
$A#*u*M flteWi1a
4upfttka) *W1

ISBN 978-7-111-31280-2
WNa4t: (010) 88378991, 88361066

ffM: (010) 68326294, 88379649, 68995259

4Mt: (010) 88379604

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).

tJtWPearson Education Asia


flL *tWfl11’FjI,
T+$ARnflficj (4J+Ifl. i1En+1ft
tthL:) WW°
fPearson Education (±flW)tkL)

$wpn, ft:vtR
*1*ItJiM

: 01-2010-4175
*4€:

(CIP) fl

t-Wflff: C141& (fl)tk 2Jt&) / () 4i (Weiss,


MA.) t4hi: I1kItflj’f±, 2010.7
(fl&1)
4Jt: Data Structures and Algorithm Analysis in C, Second Edition
ISBN 978-7-llt-31280-2

It” ffi.©flt4j-fl fl5YW-fl ©Ci—


W.cDTP3II.l2 ©TP312
)i&t±—t

+RCIPflIfl (2010) l3l749

t1L4itLEJkLBJtE ( $M[KWEFk#522 IIIi&IIII 100037)

4hT)4j[j (1JR± /1 Efl’j

l50mmx2l4mm l6.5EFJ*
ISBN 978-7-111-31280-2
tift: 45.005

FLWJ$4S, 1znt, ifUT. ,


tNt: (010) 88378991; 88361066
(010) 68326294; 88379649; 68995259
&&: (010) 88379604
imt1u: [email protected]
tnrn, *Wff*M*t*n flflfl*fl fV
t4*fltThEth &IELSWØIf4
, flflfliVc±flfñLflB. flL flAk
ftflWrt, Ak-*fltt, ttflfl+

tt’P, 4fltJTlWfl, 3S4W5ITflflWL4!, R3EV**fl,


flflL #-
i, flflht*?#HbT aNB’fWtJU9ktiME,
tflAtfl HtLiftifl0
ftMfl; Akt fl±flSL fl1*I
t*flBt1H1fltIflT, Nttfl4M4*flJL
-h*ifltfl#O3VFSflfl2ib0 hFt, Kli—ft

, &&-flfl. A*2J°
4WIS$flfli 3b&ftfl”. 1998

4Jfl, tH]ti#IWtflT. fl[9hfl*#±O in


41fl4WJJ, {f]Pearson, McGraw-Hill, Elsevier, MIT, John

Wiley & Sons, Cengage W1}L1LTaM1E, Ak


S. Tanenbaum, Bjarne

Stroustrup, Brain W. Kernighan, Dennis Ritchie, Jim Gray, Afred V.

Aho, John E. Hopcroft, Jeffrey D. Uliman, Abraham Silberschatz,

William Stallings, Donald E. Knuth, John L. Hennessy, Larry L.

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

[email protected] =

(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

a algorithm analysis. Students should have some knowledge


first-year graduate course in
of intermediate programming, including such topics as pointers and recursion,
and some background in discrete math.

Approach
I believe it is important for students
to learn how to program for themselves, not

how to copy programs frombook. On the other hand, it is virtually impossible to


a

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

courses, permits, then Chapter 10 can be covered. A graduate course


If time

on algorithm analysis could cover Chapters 7—11.The advanced data structures


analyzed in Chapter 11 can easily be referred to in the earlier chapters. The
discussion of NP-completeness in Chapter 9 is far too brief to be used in such a
course. Garey and Johnson’s book on NP-completeness can be used to augment this
text.

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

http://www.aw.com/cseng/ (follow the links from there). The exact location of


this material may change.

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

1.2. Mathematics Review 3


12.1. Exponents 3
1.2.2. Logarithms 3
1.2,3. Series 4
1.2.4. Modular Aiithmetic 5
1.2.5. ThePWord 6

1.3. A Brief Introduction to Recursion 8

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

3 Lists, Stacks, and Queues 41


3.1. Abstract Data Types (Ts) 41
3.2. TheListnr 42
3.2.1. Simple Array implementation of Lists 43
3.2.2. Linked Lists 43
3.2.3. ProgrammIng Details 44
3.2.4. Common Errors 49
3.2.5. Doubly Linked Lists 51
3.2.6. CircularlylinkedLists 52
3.2.7. Examples 52
3.2.8. Cursor Implementation of Linked Lists 57

3.3. The StackAwT 62


3.3.1. Stack Model 62
3.3.2. Implementation of Stacks 63
3.3.3. Applications 71

3.4. The Queue ADT 79


3.4.1. Queue Model 79
3.4.2. Array Implementation of Queues 79
3.4.3. Applications of Queues 84
Summary 85
Exercises 85

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

4.3. The Search Tree ADT—Binaly


Search Trees 100
4.3.1. MakeEmpty 101

4.3.2. Find 101

4.3.3. FindMin and FindMax 103


4.3.4. Insert 104
4.3.5 Delete 105
4.3.6. Average-Case Analysis 107
4.4. AvLTrees 110
4.4.1. SingleRotation 112
4.4.2. DoubleRotation 115
Contents xi

4.5. SplayTrees 123


4.5.1. ASimpleldea(ThatDoesNotWork) 124
4.5.2. Splaying 126
4.6. Tree Traversals (Revisited) 132
4.7. B-Trees 133
Summary 138
Exercises 139
References 146

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

6 Priority Queues (Heaps) 177


6.1. Model 177
6.2. Simple ImplementatIons 178
6.3. Binary Heap 179
6.3.1. Structure Property 179
6.3.2. Heap Order Property 180
6.3.3. BasIc Heap Operations 182
6.3.4. Other Heap Operations 186

6.4. Applications of Priority Queues 189


6.4.1. The Selection Problem 189
6.4.2. Ent Simulation 191
xii Contents

6.5. d-Heaps 192


6.6. Leftist Heaps 193
6.6.1. LeftistHeapProperty 193
6.6.2. Leftist Heap Operations 194

6.7. Skew Heaps 200


6.8. Binomial Queues 202
6.8.1. Binomial Queue Structure 202
6.8.2. Binomial Queue Operations 204
6.8.3. Implementation of Binomial Queues 205

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

7.3. A Lower Bound for Simple Sorting Algorithms 221

7.4. Sheilsort 222


7.4.1. Worst-Case Analysis of Sheilsort 224

7.5. Heapsort 226


7.5.1. Analysis of Heapsorl 228

7.6. Mergesort 230


7.6.1. Analysis of Mergesort 232
7.7. Quicksort 235
7.7.1. PickingihePivot 236
7.7.2. Partitioning Strategy 237
7.7.3. Small Arrays 240
7.7.4. AcWal Quicksort Routines 240
7.7.5. Analysis of Quicksort 241
7.7.6. A Linear-Expected-Time Algorithm for Selection 245
7.8. Sorting Large Structures 247
7.9. A General Lower Bound for Sorting 247
7.9.1. Decision Trees 247

7.10. Bucket Sort 250

7.11. ExternalSorting 250


7.11.1. WhyWeNeedNewAlgorithnis 251
7.11.2. ModelforExternalSorting 251
Contents xiii

7.11.3. TheSimpleAlgorithm 251


7.11.4. Multiway Merge 253
7.11.5. Polyphase Merge 254
7.11.6. Replacement Selection 255
Summary 256
Exercises 257
References 261

8 The Disjoint Set AI)T 263


8.1. Equivalence Relations 263
8.2. The Dynamic Equivalence Problem 264
8.3. Basic Data Structure 265
8.4. Smart Union Algorithms 269
8.5. Path Compression 271
8.6. Worst Case for Union-by-Rank and Path Compression 273
8.6.1. Analysis of the Union/Find Algorithm 273

8.7. AnApplication 279


Summary 279
Exercises 280
References 281

9 Graph Algorithms 283


9.1. Definitions 283
9.1.1. Representation of Graphs 284

9.2. Topological Sort 286

9.3. Shortest-Path Algorithms 290


9.3.1. Unweighted Shortest Paths 291
9.3.2. Dijkstra’sAlgorithm 295
9.3.3. Graphs with Negative Edge Costs 304
9.3.4. Acydic Graphs 305
9.3.5. All-Pairs Shortest Path 308

9.4. Network Flow Problems 308


9.4.1. A Simple Maximum-Flow Algorithm 309

9.5. Minimum Spanning Tree 313


9.5.1. Prim’s Algorithm 314
9.5.2. Kruskal’s Algorithm 316
xiv Contents

9.6. Applications of Depth-First Search 319


9.6.1. Undirected Graphs 320
9.6.2. Biconnectivity 322
9.6.3. Euler Circuits 326
9.6.4. Directed Graphs 329
9.6.5. Finding Strong Components 331

9.7. Introduction to NP-Completeness 332


9.7.1. Easy vs. Hard 333
9.7.2. The ClassNP 334
9.7.3. M’-Complete Problems 335

Summary 337
Exercises 337
References 343

10 Algorithm Design Techniques 347


10.1, GreedyAlgorithms 347
10.1.1. ASimpleSchedulingProblem 348
10.1.2. Huffman Codes 351
10.1.3. ApproximateBinPacking 357
10.2. Divide and Conquer 365
10.2.1. RunningThneofDivideandConquerAlgorithms 366
10.2.2. Closest-Points Problem 368
10.2.3. The Selection Problem 373
10.2.4. Theoretical Improvements for Arithmetic Problems 376

10.3. Dynamic Programming 380


10.3.1. UsingaTableinsteadofRecursion 380
10.3.2. Ordering Matrix Multiplications 383
10.3.3. Optimal Binary Search Tree 387
10.3.4. MI-Pairs Shortest Path 390

10.4. Randomized Algorithms 392


10.4.1. Random Number Generators 394
10.4.2. Skip Lists 397
10.4.3. Primality Testing 399

10.5. Backtracking Algorithms 401


10.5.1. The Turnpike Reconstrnction Problem 403
10.5.2. Games 407
Summary 413
Exercises 415
References 422
Contents xv

11 Amortized Analysis 427


11.1. AnUnrelatedPuzzle 428

11.2. BinomialQueues 428


11.3. Skew Heaps 433
11.4. Fibonacci Heaps 435
11.4.1. CuttingNodesinLeftistlleaps 436
11.4.2. Lazy Merging for Binomial Queues 439
11.4.3. The Fibonacci Heap Operations 442
11.4.4. Proof of the Time Bound 443

11.5. SplayTrees 445


Summary 449
Exercises 450
References 451

12 Advanced Dala Structures and Implementation 453


12.1. Top-Down Splay Trees 453
12.2. RedBlackTrees 457
12.2.1. Bottom-Up Insertion 462
12.2.2. Top-Down Red Black Trees 463
12.2.3. Top-Down Deletion 465

12.3. Deterministic Skip Lists 469


12.4. AA-Trees 476
12.5. Treaps 482
12.6. k-dTrees 485
12.7. Pairing Heaps 488
Summary 494
Exercises 495
References 497

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.

Briefly review recursion.

1.1. What’s the Book About?

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

of time; each requires several days of computer processing to terminate (albeit


2 Data Structures and Algorithm Analysis in C

eventually with a correct answer). An alternative method, discussed in Chapter 7,


gives a solution in about
second. Thus, although our proposed algorithms work,
a

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.

Figure Li Sample word puzzle

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

1.2. Mathematics Review

This section lists some of the basic formulas you need to memorize or be able to

derive and reviews basic proof techniques.

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

Several convenient equalities follow from this definition.

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,
= =

proving the theorem.

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

M y first trip to Europe cost me forty dollars and my faith in


human nature. The former was the price of an emigrant ticket
on the boat and my food from London to Paris; the latter was caused
by my lending a fellow passenger—a Frenchman—my best overcoat
and never seeing it again. As he taught me a great deal of French,
however, I may have been repaid.
There was never an idle moment in the steerage. Every noon we
were all hustled up onto the deck—even to a man with a broken back
—and our bunks washed out with chloride of lime. This was before
the days of wholesale fumigation, and the company was taking no
chances. At mealtime were brought in huge baskets of bread and
large cans of coffee; we produced our own dishes and were fed much
in the fashion of a barbecue, with hunks of meat. After two days I
was invited by the purser to sit at his table, and so dined in splendor
with the cooks, steward, and “barkeep” on virtually the same fare as
the first cabin.
One night we arranged a mock marriage between a giggling Irish
girl and rather a crazy fellow with a gray beard. I was the high priest.
The barkeeper had given us some whisky and the noise of the
merrymaking must have reached the upper deck, for just at its height
the leading lady and some members of a well-known opera company
that was crossing came down with the captain to see our show. I
knew that this would mean the dampening of all our fun, so I
stopped them, saying that we had not been invited to their
entertainments, and demanded that the privacy of the emigrants
should not be broken. The captain seemed amused, but agreed, and
they went away, much to the annoyance of the opera star.
I remember being very much impressed with the shore of Ireland
which showed once through the fog, looking so like a large emerald
that I immediately saw where the island got its name. This dark, dark
green, soaked in rain, was very extraordinary.
A brief stop at Liverpool, where a pretty barmaid drew me a
tankard of stout that was the nearest thing to God’s nectar I ever
tasted; then on to London; directly to Paris; the Hotel de Londres
and—Julian’s!
Off the Passage de Panorama, which is just off the Boulevard, is
the Galerie Montmartre. Here, up one flight of stairs, over a public
cabinet d’aisance, in the dingiest place imaginable, was the
Académie Julian. The room was dirty and dark, despite the skylight
above; at one end a platform, and near it a soiled bit of drapery
behind which the women models stripped. On a hot July day, what
with paints, dirty Frenchmen, stuffy air, nude models, and the place
below, this room stank worse than anything I can think of. Not much
calculation for comfort, but possibly an enormous inspiration for
genius.
Julian had his office below, but was not there with any regularity,
generally coming in to loaf or to see new girls. He was a Hercules and
quite a romantic figure, about whom there were many stories. They
say he was the Masked Man who used to wrestle on the stage and at
county fairs. This hulking fellow had been rather a good painter and
had become a most successful business man. Born an Italian
peasant, he had spent the early years of his life as a goatherd. To me
he always looked exactly like a great big orangutan. The three
hundred francs a year he received from each one of us seemed a
small sum; but the models were paid only a few cents a day, the
rental of the studio must have been negligible, and such men as
Lefebvre, Boulanger, Bougereau, Tony Fleury, and after him Tony
Robert Fleury, gave their instruction gratuitously. So it was not such
a bad business deal after all.
One of the older students was the massier, or boss. He chose the
model for the week or had one voted upon from the crowd of poor
devils who lined the stairway every Monday morning in hopes of a
job. This day we grabbed our places; first come, first served. If
anyone came into the room, other than Julian or an ancien (old
student), there were hurled at him paint tubes, stools, cigar butts,
oaths, and comments upon his appearance and clothing. This was a
tradition of the school and had to be lived up to.
Some of the pupils were old men with gray hair who had been
there fifteen or twenty years, still working away, I suppose, like some
men who stay in prison after their terms are up, having got used to
the place. One day a tall Englishman—I think he called himself
Vernon—turned up. He was about fifty-five years old, hollow
cheeked, with sad eyes looking out from under great brows. He came
every day and worked hard, but his painting was not very good. He
always made a pretty model’s legs look like twisted rope. One
morning he called me over to criticize his drawing, and I asked him
why he was doing this. He told me he was an art lover, owned a great
many pictures, and thought he would get a far greater appreciation of
them by doing the actual work. He stayed about two months and
some time after we learned that he was Lord Dufferin, who had just
come from the post of Governor-General of Canada and was on his
way to St. Petersburg. Imagine the shame of a certain pupil from
England who had constantly boasted in a truly British manner (and,
indeed, in “Mr. Vernon’s” very presence) of his close friendship with
Lord Dufferin!
But all the students were not old. Most of them were quite young,
and some very unsophisticated. I remember a blond fellow, green,
and straight from the country, who had received a hundred francs a
month from the citizens of his home town to complete his art
education. One day he came running into the studio, breathless,
stammering out a most amazing story. He had been staring in a
jeweler’s window when a beautiful woman, “an angel,” approached
him, saying:
“Who art thou?”
“Your servant.”
She took him by the arm to her barouche, and he drove with her to
a magnificent house on the Champs Élysées. There servants took
charge of him and arrayed him in fine clothing. The details of the
next three days were very vague, but he lived in a dream. One of the
things he did was to drive with her into the country at 4 A.M. to drink
milk fresh from the cows. It was another story of Diana and
Endymion, but all he could say was:
“She was a goddess.”
We were inclined to disbelieve his tale until one evening we took
him to the Variétés, whose back door opened into the same galerie as
Julian’s. There, on the stage, he discovered his “goddess.” She was
Judic, a famous actress of the day, well known for her curious
amours!
Most of us students were poor. I had fifty dollars a month
allowance, but I roomed with a fellow who had only twenty for
everything—and he made it do. We lived in the rue de Douai in
Montmartre. The room, six flights up, with a trapdoor for a window,
was furnished with two iron cots and very little else. I remember we
used champagne bottles for water ewers. For all this we paid thirty
francs a month. No heat, of course, and in winter the cold was
unspeakable. One night I got an idea, and, taking my blanket, started
across the icy red-tiled floor to get into my roommate’s bunk. In the
middle of the room I ran into something. It was he coming to sleep
with me! We laughed and went out and bought a roast chicken and a
bottle of wine. It did not take much to start a party in those days.
We could not afford the theater, but would go now and then to sit
on the boulevards over our beer. The wicked thing was to go to the
Café Américain and drink with the girls. Here one night I saw an
amusing thing. A little fellow with varnished boots, loud clothes, and
a gay tie, showing every outward vulgarity that some Americans can
show, was sitting on the balcony with two large, fat women.
Suddenly, a row started below—bad words and then loud oaths in
English—and a blow. The French do not do this; they slap the face,
but do not use the fist.
“Un coup de poing Anglais!”
We looked down. Five or six Frenchmen were upon two
Americans; and then one yelled:
“Any Americans here?”
The little fellow got up. He was terribly drunk, but, stepping on his
chair, he climbed upon the railing of the balcony, balanced himself a
moment unsteadily, and then leaped wildly into the crowd, shouting:
“I don’t amount to much, but here goes!”
When the calm was restored it was seen that his action had had the
desired affect, for several arms were broken and one or two
Frenchmen were completely knocked out; but for an exhibition of
true heroism and Americanism, it was gorgeous.
A great event was the Bal Bullier—the students’ ball; everyone
went, and it was “artist” all through. Things always went well unless
some one broke one of the unwritten laws. For instance, all the
women who amounted to anything wore masks, and to take them off
was an invitation to everyone. One evening at one of these affairs I
suddenly heard:
“Any Americans here?”
In the middle of the floor, surrounded by dozens of Frenchmen
and fighting with his fists, was an upstanding male in a cowboy hat—
a fashion then unknown in Paris. Some one had broken the rule and
taken his girl away from him. In a flash I recognized him as Charley
White, a man I had known in the north of California.
I looked about me and yelled to each corner of the room:
“À moi, Julian! À moi, Julian!”
Instantly dozens of men sprang from all sides with cries of:
“À toi, Simmons! À toi, Simmons!”
In a second they were upon their brother Frenchmen, had downed
them, and had hustled Charley White out of the room. No matter
where one is in France, he can always call his class to his side;
architects stick to architects, actors to actors, painters to painters,
and so on. I could never convince my friend, however, that I did not
employ private police.
These nights of revelry were few and far between; our evenings
were spent in the studio, and I always see them in “black and white.”
Black were the shadows in the recesses not reached by the big gas
flame, black were the heads of the Europeans, strange beings to me
at that time, some of them with beards; while the body of the model,
the straining faces of the students, and the paper on the easels before
us were a gleaming, glaring white. We did drawing alone at night.
Up to this time there had been one and only one real influence
upon my artistic life, and that was Doctor Rimmer. While at the
Boston Art Museum I used to go over to the Institute of Technology
to his classes in art anatomy. Dr. William Rimmer, who is only to-
day being given any recognition, probably occupies in the artistic
world somewhat the same position that Samuel Butler does in the
literary world. Rimmer’s work is being dragged out of obscurity to-
day by men like Gutzon Borglum, as Butler’s was by Bernard Shaw.
He was a large man with a foreign accent, a crank, but an
enthusiast and very excitable. His absorption in his work was that of
a crazy genius, but his knowledge of the structure of the human
figure, combined with his delicate sense of beauty and vigor of
execution, was of inestimable value. In his life he was absolutely
impersonal and cared for no man. Doctor Rimmer did me more good
than any other man except one—Boulanger.
I had been told by Crowinshield, in Boston, that I had something
that would be of great value in the future, but was very dangerous
then—chic. With the conceit of youth, I thought it meant something,
so I began to paint as soon as I joined Julian’s. My first work was the
head of an Italian; it was very bad. Boulanger stopped in back of me
and said:
“If you go on this way, you might as well go home and make
shoes.”
A thing like that had seldom happened to me; I couldn’t help
showing off, and it hit hard. I realized that the criticism was right,
but I thought that he should have told me how to cure myself. So I
left the room and waited on the stairs for a half hour before he came
out. Seeing me, he tried to push by, but I stopped him, saying:
“I admit everything you said. I do not know anything, but I came
here to learn. (By this time the tears were streaming down my
cheeks.) You shall not leave here until you tell me what to do.”
He thought for a moment. “Well, have you seen the outline
drawings by Gérôme?”
I thought them the finest things I knew of, and said so.
“Go back and make one, and mind you, young man, see that you
take a week over it. Good morning.”
These drawings were larger than the academy paper, so I got a
three-foot stretcher and put wrapping paper on it. They wouldn’t let
me in the front row at school because it was too large and obstructed
everyone else’s view; I had, therefore, to go in the back of the room
and stand up to see the model. In two days I had finished it, and I
started it over again, rubbing out so much that I wore holes in the
paper. After one every week for three weeks, they came easier.
Boulanger was away on a vacation, and when he came back he
passed me by as though I did not exist. July, August, September went
by and still he ignored me. I was too scared and miserable to speak to
him. Finally, one day he walked in back of my easel and halted as if
shot! Turning to the whole school, he said:
“None of you could do a drawing like this, and I doubt if any one of
you could copy it.” Then turning to me, “Let’s see you make an
academy.”
I switched from being a loafer and chiquer from that moment, and
realized that only by eight hours’ daily work and hard digging could I
become a painter. The next week there was a prize offered of a
hundred francs for the best drawing—and I won it.
My first showing was at the Salon of ’81. We students used to
congregate at the Palais de l’Industrie and watch the four or five
thousand pictures arrive for selection. From these only about two
thousand were chosen. We were a great crowd, lining the grand
stairway or sitting on the balustrade, and it was everybody’s business
to be funny. First would come vans and wagons from which would
issue twenty and sometimes forty pictures; then messengers; poor
artists with their one creation; and last the commissionaires who
carried the canvases on the easel-like thing they had on their
shoulders. Of course, the barnyard pictures brought forth loud
cackles and crows—this being my special accomplishment. Every
now and then some girl would arrive with a portait of “Mother” (too
poor to have it sent). Everyone would weep copiously. Up the
stairway, with great ceremony, would come a portrait of some high
official; we would all assume a manner of awe, but as it turned the
corner—loud shouts of “Merde!” I remember mine (I was so
ashamed of it) in a big frame so large that it had to be borne by two
men. It was a portrait of a Scotchman in kilts.
“À biens l’horreur! It is of our friend Simmons. Shame! Shame!”
(for the bare knees).
Up it went, and a big red-headed man from Julian’s rose and said:
“Silence for a while and tears.”
At last a wave of quiet—serious this time—and whispers all up and
down the line.
“Sh! It is the master!” A Jules Lefebvre had arrived.
Pictures accepted and hung, varnishing day was the next
excitement. Everyone of importance and all fashion turned out. New
York society cannot conceive of what a place the fine arts have in
France. Women of note at the gates with their quêteuses, soliciting
money for charity; inside, great masses of people go through the
galleries together, with some such person as Sarah Bernhardt at the
head and the lesser following. I remember seeing Madame De
Gautrot, the noted beauty of the day, and could not help stalking her
as one does a deer. Representing a type that never has appealed to
me (black as spades and white as milk), she thrilled me by the very
movement of her body. She walked as Vergil speaks of goddesses—
sliding—and seemed to take no steps. Her head and neck undulated
like that of a young doe, and something about her gave you the
impression of infinite proportion, infinite grace, and infinite balance.
Every artist wanted to make her in marble or paint, and, although
she has been done innumerable times, no one has succeeded.
At one Salon, in the early ’eighties, two Frenchmen, with flowing
ties and low collars, stepped in front of me to look at a landscape by
Boutet de Monvel. One said:
“There is a girl in England named Kate Greenaway who is doing
some very clever work. She doesn’t know anything about drawing or
color, but her idea is certainly original. Some day some man will take
it and get a great name by it.”
I never forgot this, for the speaker was De Monvel himself, and he
certainly did scoop the idea.
One who always attracted a crowd was Rosa Bonheur—she who
was made famous and wealthy by American dollars. She looked like a
small, undersized man, wore gray trousers, Prince Albert coat and
top hat to these affairs. Her face was gray white and wizened, and she
gesticulated, speaking in a high, squeaky voice. I have never seen
anyone who gave a more perfect impression of a eunuch.
The Salon was not all fun; there were many tragedies. One day I
called on my friend Renouf, a first-medalist, who was painting a
decoration in the Palais de l’Industrie. The Salon had been closed a
month, but there were hundreds of rejected canvases standing
outside that had never been called for. Some were not even framed.
He hauled out several pathetic attempts; then, coming upon one,
said:
“Did you ever hear of a painter named G——? He has just been
locked up; crazy.”
The picture was about six by ten feet, had no frame, but it was
signed in large letters. It was a scene of a long corridor, with two
barred windows on the side and a man crouched against the wall,
with the most maniacal expression on his face. I never have forgotten
the horror; he must have painted it when he was going crazy. I often
think of poor De Maupassant, whose extreme intelligence warned
him of approaching insanity and who, having a gun, desired to take
his life. Of course, the gracious Christians surrounding him preferred
his earthly sufferings to his heavenly happiness, and so prevented
him from doing it.
Ten years after a man of prominence in the artistic world dies the
French give a showing of his work. This places him historically as an
artist. Some of his pictures are purchased by the government and,
after this exhibition, if the authorities deem him great enough,
pictures by him are moved to the Louvre. I remember the ten-year
show of Courbet. He had been an anarchist, also one of the leaders in
the Commune, and his work was considered frightfully “modern.” He
was the brutal sort of painter that our present-day young men try to
emulate, but, though he died many years ago, Courbet was a far abler
painter than any man now alive in America.
Of course, this realism of execution brought forth much criticism
from the members of the so-called old-school artists, and among the
leaders in denouncing Courbet (while alive) was that classic
authority, Tony Fleury. He considered this type of art worthless and
all wrong and, if I mistake not, expressed his opinion of the modern
man in the newspapers.
On the opening day of the Courbet show (there was a smart crowd,
as there always is at these affairs) I noticed the attention was
suddenly turned in one direction and people seemed to be following
some one. Sure enough, with his hands behind his back under coat
tails was that notorious enemy of the dead painter, the venerable
Tony Fleury, pottering around the room and examining each picture
with great care. Then a striking thing happened—so theatrical and so
French.
Whirling and facing the audience, he spoke:
“Gentlemen and ladies, for many years I have said that this man
was a bad painter. I was mistaken. He was a genius!”
Whistler was a well-known figure at all Salons, but I first met him
in London, where I visited him with a letter of introduction from my
aunt Fanny, who had trotted him on her knee when he was a baby.
He was charming, said there was something he had to do, and, if I
could wait for him, the day was mine. He handed me a portfolio of
drawings to look at while he was gone, saying:
“Some things I picked up in Italy.”
When he came back I told him, with the arrogance of youth, that I
hadn’t cared at all for some of the etchings and wondered why he had
bought them. He was very curious to know which ones I meant, but
never told me, what I found out later, that they were all his own! The
well-known Venetian etchings!
We lunched at the Hogarth Club and back to his studio to look at
his work—me to drink in fountains of knowledge and he to be much
amused at my untrained conversation. The studio was large,
dignified, and very bare. I remember multitudes of little galley pots
in which to mix colors. His painting table had a glass top, and I made
a mental decision to have one like it. Whistler always had his own
canvas made for him and was extremely careful about all his
materials.
His accent was very English and he was full of mannerisms,
constantly fooling with his eyeglass or the lace at his throat. He asked
about Paris, and I told him of the first show of the Impressionists,
held on the Boulevard des Capucines; of Monet, Sisley, etc. The
pictures had looked crazy to the people of the day. Whistler said:
“Oh, I know those fellows; they are a bunch of Johnnies who have
seen my earlier work.”
Considering that his earlier work looks pre-Raphaelite or stuffy
German, this was a curious remark.
A large manservant in full livery brought out the pictures to show
us. He wore white gloves and was careful not to touch the surface of
the canvas. I remember the portrait of Sarasate; it was very large and
the servant acted as an easel, holding it on his toes, with his two
hands at the sides. Our conversation became quite interesting at the
moment, and his master left him standing in that position for more
than half an hour while we talked of other things. I thought this very
inconsiderate, as we had never treated servants that way. It was this
same portrait of Sarasate that I later saw finished in the Salon.
Whistler had kicked up a great row, because it had occupied only the
central position of the left-hand room instead of the right, which was
more popular. He spoke to me about it, and I told him that he should
not care, as the poor fiddler looked as if he were trying to commit
suicide in the Metropolitan subway. He tried to get angry and wanted
to know why. The figure was all black, with the signature (a gold
butterfly) looking like the headlight of an engine, about to dash it
into oblivion.
Whistler could always find plenty of adorers to sit at his feet and
let him use them as a doormat. The Claimant in Lemon Yellow told
me that he was hurrying home with him one evening in the rain,
when the master spied something that pleased his æsthetic taste. It
was a little lighted grocer’s window. He stopped like a pointer dog,
ordered the Claimant to go home, a mile or more, and get his box.
Then he started painting like mad in the dark, and for more than an
hour the Claimant held his umbrella over him and handed him his
materials. Truly, the man had an hypnotic power.
Whistler was all heart and all pocketbook to any poor unknown
and, for all his arrogance, the servants loved him; but he could never
resist a chance to rap Authority. He sent his “second-class thanks”
for a second-class medal awarded him at the Salon. Considering the
fact that this is the highest honor a foreigner gets, it seems, for once,
that the little man lost his sense of humor. He couldn’t resist getting
in his knock at the English, either. I remember a phrase in a letter
written by him to a friend of mine.
“Yes, Sid, here I am again in Paris and gentle Peace seems at last to
be inclined to take up her permanent abode in my little pavilion; but
I shall drop back across the Channel, now and again, just to see that
too great a sense of security may not come upon the people.” They
reveled in it; he was master then, and the British love to be
patronized by some one who has arrived.
I once rented a studio that Whistler had used, and the decorator,
who had a shop below, told me that he had changed the color of the
wall to agree with every new picture he painted. On one side of the
room was a large space filled with palette scrapings. When I think of
Abbott Thayer, I know I must have missed a good business deal by
not cutting them off to sell to his admirers in the U. S. A. Mr. Thayer
was giving an outdoor lesson to a number of girls and, wishing to sit
down, and also having on a new pair of trousers, he went over to a
near-by barn and got a shingle. When he left he heard a sound like a
football rush. The girls were fighting for the shingle!
There is a letter of Whistler’s, written in the ’sixties, to Fantin
Latour, which I am going to quote, trusting there may be some young
artist, in however remote a land, who, reading it for the first time,
will say:
“I will profit; I will learn my trade.”
Dear Fantin—I have far too many things to tell you for me to write them all this
morning, for I am in an impossible press of work. It is the pain of giving birth. You
know what that is. I have several pictures in my head and they issue with difficulty.
For I must tell you that I am grown exacting and “difficile”—very different from
what I was when I threw everything pell-mell on canvas, knowing that instinct and
fine color would carry me through. Ah, my dear Fantin, what an education I have
given myself! Or, rather, what a fearful want of education I am conscious of! With
the fine gifts I naturally possess, what a painter I should now be, if, vain and
satisfied with these powers, I hadn’t disregarded everything else! You see I came at
an unfortunate moment. Courbet and his influence were odious. The regret, the
rage, even the hatred I feel for all that now, would perhaps astonish you, but here is
the explanation. It isn’t poor Courbet that I loathe, nor even his works; I recognize,
as I always did, their qualities. Nor do I lament the influence of his painting on
mine. There isn’t any one will be found in my canvases. That can’t be otherwise, for
I am too individual and have always been rich in qualities which he hadn’t and
which were enough for me. But this is why all that was so bad for me.
That damned realism made such a direct appeal to my vanity as a painter, and,
flouting all traditions, I shouted, with the assurance of ignorance, “Vive la Nature!”
“Nature,” my boy—that cry was a piece of bad luck for me. My friend, our little
society was as refractory as you like. Oh, why wasn’t I a pupil of Ingres?—How
safely he would have led us!
Drawing! by Jove! Color—color is vice. Certainly it can be and has the right to be
one of the finest virtues. Grasped with a strong hand, controlled by her master
drawing, color is a splendid bride, with a husband worthy of her—her lover, but her
master, too, the most magnificent mistress in the world, and the result is to be seen
in all the lovely things produced from their union. But coupled with indecision,
with a weak, timid, vicious drawing, easily satisfied, color becomes a jade making
game of her mate, and abusing him just as she pleases, taking the thing lightly so
long as she has a good time, treating her unfortunate companion like a duffer who
bores her—which is just what he does. And look at the result! a chaos of
intoxication, of trickery, regret, unfinished things. Well, enough of this. It explains
the immense amount of work that I am now doing. I have been teaching myself
thus for a year or more and I am sure that I shall make up the wasted time. But—
what labor and pain!
One advantage in not having money in Europe is that it forces one
to live with the natives and not mingle with transplanted America,
vulgar with luxury, that exists in every large capital. We had a good
chance to learn the French nature, bear with its eccentricities, and
appreciate its wonderful charm. They never miss a chance to make a
witty remark. I remember a girl about twenty-five, but looking
sixteen, with bobbed hair (unusual in those days), conspicuously
short skirts, and woolen stockings, looking distinctly the poor
gentlewoman, walking down the boulevard one day entirely alone.
Under her arm was a violin case, looking exactly like a coffin. Each
café has its character, and as she passed the Café de Madrid, with its
gathering of literary people, a perfectly dressed Frenchman, lavender
tie and all, at one of the outer tables rose, raised his hat and said:
“Ah, Mademoiselle! Tu vas enterrer la petite?” (“You go to bury
the little one?”)
There was dead silence until she was out of sight, when every man
in the café rose and lifted his hat to the speaker. We, in America, are
not in consonance with wit and beauty as they are.
If you make good in Paris, it is all right. The students once carried
a nude model all over the city, and the citizens respectfully bowed to
Beauty. Again, conversely, an actress who appeared in a play in the
nude was madly applauded—until she made the fatal and inartistic
mistake of taking a curtain call. She was hissed off the stage. I
remember Rochegrosse, a fellow painter, picking up a red-velvet-
and-gold hat of the Louis Onze period, one day in the studio. It made
him look exactly like a mediæval page. Without thinking, he wore it
out—the whole length of the boulevard. No one thought to laugh, but
all stopped and said “Admirable.” You must not be ridiculous in
France, but you are not necessarily ridiculous just because you differ
from the crowd, as you are in America.
My only meeting with the haut noblesse of France did not leave me
with a very good impression of that society which it is practically
impossible to penetrate. I had been asked by a friend of mine, in
Colorado, to play gallant to the beautiful singer, Marie Van Zant, to
whom he was betrothed. My first act of friendship was to try to
protect her from a marquis who had been forcing his attentions. The
marquis had bet forty thousand francs that he would make her his
mistress, and wrote, asking her to be a party to his game and share
the money. Receiving no answer to this proposal, he sent a bouquet
to Miss Van Zant’s dressing room in which was a note stating that if
she did not accept his offer he would publicly insult her as she left
the theater. Then she appealed to me.
I had a carriage waiting at the stage door that evening, into which I
quickly bundled both singer and her mother and, in order to avoid
any further scandal, sent them off alone. But I was mistaken. The
marquis must have been before me and bribed the coachman to go to
a different address. Before they knew it they had stopped before a
brilliantly lighted restaurant and the young man was running down
the steps to meet them. Marie succeeded in avoiding him by
threatening the coachman with arrest if he did not take them home.
But some woman got hold of the story, and there was a scandalous
article in one of the papers in America. Twelve days after it appeared
my friend was in Paris and, coming to my rooms, asked me to meet
him at a certain hour as he was going to shoot a Frenchman. He
asked me to be one of his seconds and I carried his challenge to the
marquis. The nobleman was a mere boy and pleaded that he was too
nearsighted to use pistols, and, as my friend did not know the use of
swords, the duel came to nothing. I did not know enough to ask for a
Jury of Honor or he would have been forced to go on the field. One
very characteristically French thing came out of the affair, however,
when the marquis tried to pooh-pooh my overtures for a fight on the
basis that no “actress” could be insulted in his country and that it
was only because we were Americans that he would consider the
matter at all.
We sometimes went to the Closerie des Lilas, at the corner of the
Boulevard St.-Martin. This was quite in the country, in the days of
Henri Quatre—a sort of road house where the young bloods went to
drink. The women of the court discovered this and used to go out
there, disguised as milkmaids, and flirt outrageously with the tipsy
members of the nobility. Alas! the lilacs are gone now and sportive
milkmaids no longer frequent the place; but the Cafe des Lilas still
has its stories, and in my day there was at least one interesting
habitué. He was a major whom everybody knew and spoke to
familiarly. He was gray bearded and must have had his title from the
Franco-Prussian War. He and his cronies had the same table, played
piquet, and sat for hours over their coffee. His was a mazagran. The
first time I saw him I noticed he had a funny trick which he repeated
every night. For a mazagran the waiter leaves three lumps of sugar;
he always used two, left the other in his saucer, and became
exceedingly annoyed if, by any chance, it got wet. In his right-hand
waistcoat pocket was his watch, with a great fob that went across.
With the utmost deliberation, he would reach into the left-hand
pocket, take out a piece of brown paper, beautifully cut into a square,
and fold into it the extra lump of sugar, carefully putting the package
back in his pocket again. For many nights I watched this proceeding
and made up my mind that, being a thrifty Frenchman, he used it for
his morning coffee. But not so. Some time after, I read in the Figaro
that Major P—— who lived in Montparnasse (there was no mistaking
the name and place), had died suddenly, leaving no estate and no
personal effects; but behind the door of his small bedroom had been
found—a cubic yard of sugar!
Verlaine sometimes came to this café—Paul Verlaine; I often paid
for his beer. A plain, hairy, dirty figure, seeming physically very
feeble; you would not think to look at him twice except to marvel at
his ugliness and disorderly appearance, unless you saw his eyes. If he
looked at you, you knew you were in the presence of your better. He
was worshiped by all, and they fought to pay his check, hovering
about him like crows around dead carrion, waiting to snatch at
anything that dropped from his lips. I was not a good student of
character in those days and in no way realized his importance, but I
could not help feeling his charm. One night I had a dispute with a
Frenchman as to what was the meaning of courage. One of us argued
that it was an admirable quality, and the other that it was vanity and
stupidity—therefore, idiotic. At the height of the discussion Verlaine
came in and was appealed to to decide the question. He first
demanded beer and then listened carefully to one and then the other.
Looking at me, he said:
“I decide for the young American.”
“Well, why?” asked the Frenchman.
“Because you are right and he is right; you are wrong and he is
wrong. But he believes what he says.”
To him, truth was of no importance—the question was belief—and
this seems to me to be the secret of his whole philosophy.
There is a corner in Paris where Arthur Cosslet Smith says, if you
sit there long enough, you will meet everyone of importance of your
day—the corner of the Café de la Paix. Here one day I was sitting,
having an apéritif before lunch; at a table in the corner was gathered
a group of jeunesses dorées and a little farther back I noticed Barbey
d’Aurevilly. The young men began to discuss literature with that
cocksureness that is the quality of youth the world over. Victor Hugo
was still alive, and it was the fashion to “knock” him, which they
proceeded to do, outrageously. Finally, one said, so the whole café
could hear:
“Oh, your Victor Hugo, he is stupid.”
At that I felt a figure rise behind me and come forward; then I saw
this wonderful vision. About seventy, handsome, tall, dressed with
the most exquisite care, lace at his sleeves and neck; D’Aurevilly was
a count and noted duelist and distinctly of the old school. Looking as
if he had stepped straight out of a book of Dumas’, he walked up to
the young men. Instantly, their conversation was hushed. He did not
present himself, but said:
“My young friends, I also care for literature; and that is my excuse
for speaking to you. I heard your talk of Victor Hugo and I came to
tell you that I agree with you in your estimate of him. Alas! he is
stupid—stupid as the Himalayas!” (“Il est bête——bête comme les
Himalays!”)

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

A merica is a country without tradition, and the large cities of


Europe are too cosmopolitan to impress one with the fact of
fixed manners and morals. But not so in the provinces. From ’81 to
’86, I lived in Concarneau, on the Breton coast, and made a trip of
several months into Elche, Spain. I felt as if I had suddenly plunged
back into the Middle Ages. The superstitions, manners, customs, and
dress, as well as ideas, of both those places, were unchanged from
centuries ago.
Around the part of Concarneau where the poor live is a wall built
by Vauban; inside is a fortress with the sea making a moat. The
bridge, which could originally be drawn up, is now stationary, but the
doorway for a passage is still there. On the other side is the ferry to
Pont Aven. Inside the inclosure the streets are narrow and paved,
with little houses on either side. Outside is the smart part of the
town. The beauties of the sea, and, as usual, the low cost of living,
brought the artist to Concarneau.
My studio was a wheat loft, and any peasant was a model for a few
cents. We painted them in their native dress, which was picturesque
enough, and, besides, no virtuous Breton woman would allow you to
see her hair, so that it was obvious that the coif stayed on. These
headdresses gave them a distinctly mediæval air, and each town has
a certain style, more fixed than the laws of the Medes and Persians,
so that you can tell immediately where a woman comes from.
Underneath this white coif, which is always beautifully laundered
and starched, is a tight cap which holds the hair, and this, I think, is
seldom removed. The remainder of the costume (which makes them
look like Noah’s Ark women) is a heavy woolen skirt and a double-
breasted blouse. This is held together by a huge shawl pin of brass,
and under no circumstances can they be persuaded to use buttons.
Of course there are stockings and sabots.
Blanch Willis Howard wrote her book called Guenn in my studio
and it afterward became one of the popular novels of the day. I think
she greatly exaggerated the romantic quality of the artist who fell in
love with his model, however, as all the Breton peasants I ever saw
washed below the chin only twice in their lives—once when they were
born and once when married.
The peasants dance all day long. Every day seems a fête day, and
the celebrations are always held in the market place. The dance starts
with a procession, with a man at the head playing a biniou, an
instrument (the same in every Celtic country) very much like a
bagpipe. They serpentine, as do the college boys of to-day, and whirl
madly, couple by couple, with nothing but a clatter of sabots. The
virtue lies not in the grace or time, but in keeping it up the longest.
The Bretons seine their fish (sardines) in a long net with large
corks at the top and weights at the bottom. Myriads of forty-ton
boats start out before sunrise, making a picturesque sight with their
few feet of deck and large fore and aft sails, originally dyed brilliant
colors, but always faded to lovely tones of rose, gray, and tan. The
sails drop at the fishing grounds, they let out their nets, and the men
begin to row, while one, the boss, stands in the stern to throw the
bait. This imported egg of cod is called “rogue,” and as he throws it
from side to side the play of his body in action is more beautifully
Greek than anything in all Europe. Whenever I saw this I wondered
if Christ might not have performed his Miracle of the Fishes in
somewhat the same way. The catch is enormous. I have seen a net
sink, breaking a manila rope the size of my thumb. When the boat
comes in it looks as if it were entirely full of shiny fifty-cent pieces in
a flutter, and every scoop of the bucket is one of pure silver. When
cooked in that flapping condition, in beef drippings, and served with
a boiled potato, they come nearer to being perfect human food than
anything I know of.
Georges Pouchet, the ichthyologist, used to come to the Vivier in
Concarneau to study the fish forms. He was a friend of Pasteur, and
they were studying mammals as a basis for the investigation of the
human body. I lunched with him in his bachelor lodgings during the
Salon every year. He had an original way of entertaining. The
invitations were always written and very formal. I was always
received by the same manservant; lunched with him alone and upon
the same menu. We had but one dish. The servant brought in a bowl
fully two feet across, full of écrevisses; then bread, wine, and a basin
with a towel and fresh water. He said it was necessary to wash while
eating these shellfish. Of course we finished off with coffee and a
smoke.
Pouchet was an intimate friend of Alfred de Musset and told me
much about him. The poet had many fads inherited from the days of
swords, pistols, snuff, and powdered hair. For instance, he would
under no circumstances accept copper money; in fact, he would not
touch the metal in any form. Toward the end of Musset’s life he
frequented a certain café in Paris—used it as a club. He would go
there to write his letters, read his paper, etc., and with him would be
a quiet man in plain clothing whom you would not notice. At a
certain time in the evening he would make a gesture to the waiter,
who would serve him with two carafons—one of brandy and one of
absinthe. He would pour them together in one glass and, looking at
them, take out of his buttonhole his button of General of the Legion
of Honor, and put it in his waistcoat. He would then down the
mixture at once; the quiet man would approach and take him to his
carriage. No one but a Frenchman could have done this; he would
not get drunk as a member of the Legion!
Sitting one time with Pouchet and a well-known authoress,
discussing sex, he said:
“You make a mistake, mademoiselle, there are four sexes. Male—
Mr. Simmons; female—your charming self; neuter”—pointing to a
stuffy judge way down the room; “and potentially male or female.
This sex can be recognized by the human hair. It is long in the men
and short in the women. Let us call it the professorial sex.” Women’s
rights, divorce laws, etc., were then unknown in France, so this was
quite an advanced idea.
The last time I saw Pouchet was in New York. He was about sixty-
three years old. We were lunching at the Players and I asked:
“What brings you to America?”
“To study the question of tonsils.”
“Are American tonsils different from European?” I asked.
“Oh no! We are interested in the tonsils of other mammals—of the
whale.”
Just before he went back to France I asked him what conclusion
his investigation had brought forth.
“A matter of great importance,” he answered. “The fact that the
tonsil is of no importance.”
I have since heard this disputed, but I thought it very interesting
that these learned men should work so long and so hard for such a
result.
The British artists passed by Concarneau and went on to Pont
Aven, where there were ready-made landscapes for the water-
colorists. Truth to tell, they were frightened by the bigness of the
coast and left it to the French and Americans, who formed a very
happy crowd, all living at the Hotel des Voyageurs. There was
Thaddeus Jones, who has since painted a portrait of the Pope;
Alexander Harrison, the famous marine painter; Frank Chadwick;
Howard Russell Butler; M. Brion; Emile Renouf; Paul Dubois, the
sculptor; and Bastien Le Page. Bastien was the first in importance in
the Concarneau older set, being almost the father of the Realistic
movement. He was a quiet, well-bred person, swift at repartee, and
could write as corking a letter to the press as Whistler.
One day I caught him painting a sketch of the little stone church
on the shore at the edge of the town, something we had all tried. He
was drawing and painting, with meticulous care, every slate on the
roof, each with its little lichen. I brought the subject up, after dinner,
when we were sitting on the sidewalk having our coffee.
“M. Bastien,” I said (no one ever called him Le Page) “we have all
been taught by Le Febvre, Boulanger, Cabanel, and Durand to
ebaucher our subject broadly and put in only the details that are
absolutely necessary. I saw you to-day painting every slate on that
roof for its own sake. How about it?”
He laughed.
“I have tried all these different methods, but none of them got me
what I saw; so now I do everything as truthfully as I am able, then
take my picture to Paris, where, in my studio, away from nature, I
can consider it broadly and remove all the unnecessary detail.”
“Yes,” said Harrison, “but when we younger men see your picture
in the Salon we don’t think you have done what you say you do.”
He threw his hands in the air.
“Helas! Helas! Sacré Nom de Dieu! Vous avez raison. I am so
much in love with it when I see it in my studio that I cannot bear to
touch it.”
Bastien was born in Domremy, which was probably the reason he
made such an admirable painting of Jeanne d’Arc, now in the
Metropolitan Museum. He told us the details of the work. There was
no one model, except for the body, and he used several to carry out
his ideal of the head. You feel that she is a working girl and not a
pretty peasant by Bougereau. Albert Wolff wrote a stinging criticism
of it, commenting on the charm of the figure and the excellence of
the drawing and painting, but saying that the visions in the air were
idiotic. Bastien replied that the visions were not supposed to be those
of a learned man like Wolff or, indeed, his own, but those born in the
brain of Jeanne d’Arc, an uneducated girl of sixteen, whose only
knowledge of kings and queens was of the figures of the saints she
had worshiped in church.
He handled this canvas in quite an original way, and not a very
successful one. It was painted in two pieces, so that it could be easily
carried to the orchard where he worked. When finished, he and the
village cobbler sewed them together by hand, with the best linen
thread and cobbler’s wax. They then stretched it and hammered the
joining, which was filled with white and siccatif and scraped down.
When it was firm and dry, he went over it so there should be no
question of the surface, and repainted it, and, as he said, “I wager
anything that that crack does not show in a thousand years.” Alas, it
is plainly evident in the Metropolitan to-day, and the repainting
must have changed, as the color and tone where the crack is are all
wrong.
Bastien was one of the most lovable men I ever met, bright,
smiling, with a certain undercurrent of sadness—the mark of
tuberculosis was upon him then. I remember one day attempting to
tell him the meaning of an American negro song he had learned from
one of the boys, but he refused to listen, not wishing to be
disillusioned.
“No, no, Simmons, I do not wish to have it explained. I know what
it says. It is a pathetic song of a lover mourning for one he has lost.”
And he rendered it in a voice that would have brought tears to the
eyes of the average audience.
“Ze lobstere in ze lobstere pot
Ze bluefish in ze panne;
Zey suffere, oh, zey suffere not;
What I suffere for my Marie Anne.”

Poor Bastien! He was gone the next year.


It is almost impossible to speak of Bastien without mentioning that
young woman, made famous by the remark of Gladstone that she
had written the best book of the year, the woman who meant so
much in his life—Marie Bashkirtsev. Fresh from the hands of her
maid, she was a fascinating blond “vamp,” but in about twenty
minutes the charms began to go. Her hair became unruly, buttons
refused to do their duty, and slipper strings burst. She had beautiful
feet and was inclined to wear her shoes too small. I once sent her a
message saying that I would give her a sketch for one of her slippers.
She replied:
“I know the value of a new pair of slippers, but I do not know the
value of one of your pictures.”
On the apartment mantelpiece of Bojidar Karageorgivitch was a
semicircle of shoes, a slipper in the center, and two bell jars covering
riding boots at either end—all belonging to his cousin Marie. Borjidar
was a charming person; the son of a king, his mother a Russian
princess and second in line for the Serbian throne. His brother
Nicolas was a weakling, and Peter, the king, was no good. Slight,
pointed beard, and aquiline nose, he looked more the fashionable
Frenchman than anything else. Like Pierre Loti, he was smitten with
the divine Sarah, who visited him at Concarneau and left her
painting materials behind. Borjidar always seemed to be surrounded
with a halo of romance. One day we were sitting out on the pavement
and some one mentioned thumb-nails. It is said that the larger the
white moons, the greater the aristocrat. This royal prince had no
moon at all, thus indicating no ancestry; but if the sign is true, it is
not strange, since his grandfather had been an ignorant butcher who
had jumped the throne. Through his mother he had a delightful
touch. Years later I met Bojidar in Paris, and what do you suppose he
was doing? Such a brave, fine thing! He was selling jewelry, which he
designed himself, to the English snob and really making good at it.
Many people like to buy from the son of a king.
There came to Concarneau a young girl, wide eyed, eager,
temperamental, thirsting for a knowledge of life, but knowing about
as much of it as the bird just out of the egg. She was alone and
studying Art. She asked of the women folk the meaning of marriage,
and wanted to be chaperoned until she had made up her mind
whether to take the big step or not. Not so long after her
enlightenment, she announced her wedding, and with none other
than the now well-known writer—Havelock Ellis. Ellis seems to me
an example of a man who took up one subject, stuck to it, and
absorbed it thoroughly—a procedure almost always destined for
success when accompanied by brains. Some years after, I visited the
Ellises in England. There had been no children from the union, but
the one-time timid and childish wife had developed into a charming
woman, and, strange to say, a full-fledged raiser of blooded stock.
She it was who tended the wants of the baby bulls and colts, was in at
the births and deaths of the animals; while Havelock sat by the
warmth of his very delightful fireplace, smoking his pipe and
probably mulling over the psychological effect of all this on the
feminine mind. Anyway, I had a delightful time and, upon his refusal
to help her, I held the head of a baby calf while she slipped a dose of
oil down its throat, oblivious to the fact that I was ruining a beautiful
new pair of white flannel trousers.
Halfway between Concarneau and Pont Aven (that place of
predigested food for artists and ready-made motifs) at the summit of
a rise in the road, is the Rocking Stone. It is twenty feet in diameter,
almost spherical in shape, and so poised by the glacial period upon
another buried stone, that, if pressed at a certain angle, it rocks. The
legend is that the stone gained this quality at the hands of the
comtesse of the château, whose husband went to the Crusades and
left her, a bride, to his dearest friend to take care of. This he
proceeded to do by trying to make her his mistress; he was rebuffed
and became her enemy. Upon her husband’s return from the wars,
this so-called friend rushed ahead to meet him and told him his wife
had betrayed him. The count drew his sword, walked ahead to meet
Welcome to our website – the ideal destination for book lovers and
knowledge seekers. With a mission to inspire endlessly, we offer a
vast collection of books, ranging from classic literary works to
specialized publications, self-development books, and children's
literature. Each book is a new journey of discovery, expanding
knowledge and enriching the soul of the reade

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

Let us accompany you on the journey of exploring knowledge and


personal growth!

ebookfinal.com

You might also like