The Algorithm Design Manual 3rd Edition Steven S. Skiena - Get The Ebook Instantly With Just One Click
The Algorithm Design Manual 3rd Edition Steven S. Skiena - Get The Ebook Instantly With Just One Click
com
https://textbookfull.com/product/the-algorithm-design-
manual-3rd-edition-steven-s-skiena/
OR CLICK HERE
DOWLOAD EBOOK
https://textbookfull.com/product/the-data-science-design-manual-1st-
edition-steven-s-skiena/
textbookfull.com
https://textbookfull.com/product/algorithm-design-with-haskell-
richard-s-bird/
textbookfull.com
https://textbookfull.com/product/the-ethical-algorithm-the-science-of-
socially-aware-algorithm-design-6th-edition-kearns/
textbookfull.com
https://textbookfull.com/product/design-drawing-3rd-edition-francis-d-
k-ching-steven-p-juroszek/
textbookfull.com
Preclinical Manual of Prosthodontics, 3e 3rd Edition
Lakshmi S
https://textbookfull.com/product/preclinical-manual-of-
prosthodontics-3e-3rd-edition-lakshmi-s/
textbookfull.com
https://textbookfull.com/product/the-effective-security-officer-s-
training-manual-3rd-edition-ralph-brislin-auth/
textbookfull.com
https://textbookfull.com/product/the-psychology-student-writer-s-
manual-and-reader-s-guide-3rd-edition-jill-m-scott/
textbookfull.com
https://textbookfull.com/product/food-analysis-laboratory-manual-3rd-
edition-s-suzanne-nielsen-auth/
textbookfull.com
https://textbookfull.com/product/living-for-the-elderly-a-design-
manual-a-design-manual-second-and-revised-edition-eckhard-feddersen/
textbookfull.com
TEXTS IN COMPUTER SCIENCE
Texts in Computer Science
Series Editors
David Gries, Department of Computer Science, Cornell University, Ithaca, NY, USA
Orit Hazzan , Faculty of Education in Technology and Science, Technion—Israel Institute of
Technology, Haifa, Israel
Titles in this series now included in the Thomson Reuters Book Citation Index!
‘Texts in Computer Science’ (TCS) delivers high-quality instructional content for
undergraduates and graduates in all areas of computing and information science, with a
strong emphasis on core foundational and theoretical material but inclusive of some
prominent applications-related content. TCS books should be reasonably self-contained
and aim to provide students with modern and clear accounts of topics ranging across the
computing curriculum. As a result, the books are ideal for semester courses or for
individual self-study in cases where people need to expand their knowledge. All texts are
authored by established experts in their fields, reviewed internally and by the series editors,
and provide numerous examples, problems, and other pedagogical tools; many contain
fully worked solutions.
The TCS series is comprised of high-quality, self-contained books that have broad and
comprehensive coverage and are generally in hardback format and sometimes contain
color. For undergraduate textbooks that are likely to be more brief and modular in their
approach, require only black and white, and are under 275 pages, Springer offers the
flexibly designed Undergraduate Topics in Computer Science series, to which we refer
potential authors.
123
Steven S. Skiena
Department of Computer Science
Stony Brook University
Stony Brook, NY, USA
This Springer imprint is published by the registered company Springer Nature Switzerland AG
The registered company address is: Gewerbestrasse 11, 6330 Cham, Switzerland
Preface
Many professional programmers are not well prepared to tackle algorithm design
problems. This is a pity, because the techniques of algorithm design form one
of the core practical technologies of computer science.
This book is intended as a manual on algorithm design, providing access to
combinatorial algorithm technology for both students and computer profession-
als. It is divided into two parts: Techniques and Resources. The former is a
general introduction to the design and analysis of computer algorithms. The Re-
sources section is intended for browsing and reference, and comprises the catalog
of algorithmic resources, implementations, and an extensive bibliography.
To the Reader
I have been gratified by the warm reception previous editions of The Algorithm
Design Manual have received, with over 60,000 copies sold in various formats
since first being published by Springer-Verlag in 1997. Translations have ap-
peared in Chinese, Japanese, and Russian. It has been recognized as a unique
guide to using algorithmic techniques to solve problems that often arise in prac-
tice.
Much has changed in the world since the second edition of The Algorithm
Design Manual was published in 2008. The popularity of my book soared as
software companies increasingly emphasized algorithmic questions during em-
ployment interviews, and many successful job candidates have trusted The Al-
gorithm Design Manual to help them prepare for their interviews.
Although algorithm design is perhaps the most classical area of computer
science, it continues to advance and change. Randomized algorithms and data
structures have become increasingly important, particularly techniques based
on hashing. Recent breakthroughs have reduced the algorithmic complexity of
the best algorithms known for such fundamental problems as finding minimum
spanning trees, graph isomorphism, and network flows. Indeed, if we date the
origins of modern algorithm design and analysis to about 1970, then roughly
20% of modern algorithmic history has happened since the second edition of
The Algorithm Design Manual.
The time has come for a new edition of my book, incorporating changes
in the algorithmic and industrial world plus the feedback I have received from
hundreds of readers. My major goals for the third edition are:
v
vi PREFACE
• To update the reference material for all the catalog problems in the second
part of the book (The Hitchhiker’s Guide to Algorithms).
Three aspects of The Algorithm Design Manual have been particularly beloved:
(1) the hitchhiker’s guide to algorithms, (2) the war stories, and (3) the elec-
tronic component of the book. These features have been preserved and strength-
ened in this third edition:
Equally important is what is not done in this book. I do not stress the
mathematical analysis of algorithms, leaving most of the analysis as informal
arguments. You will not find a single theorem anywhere in this book. When
more details are needed, the reader should study the cited programs or refer-
ences. The goal of this manual is to get you going in the right direction as
quickly as possible.
PREFACE vii
To the Instructor
This book covers enough material for a standard Introduction to Algorithms
course. It is assumed that the reader has completed the equivalent of a second
programming course, typically titled Data Structures or Computer Science II.
A full set of lecture slides for teaching this course are available online at
www.algorist.com. Further, I make available online video lectures using these
slides to teach a full-semester algorithm course. Let me help teach your course,
through the magic of the Internet!
I have made several pedagogical improvements throughout the book, includ-
ing:
concepts clearer. Every single image in the The Algorithm Design Manual
is now rendered in living color, and the process of review has improved
the contents of most figures in the text.
Acknowledgments
Updating a book dedication every ten years focuses attention on the effects
of time. Over the lifespan of this book, Renee became my wife and then the
mother of our two children, Bonnie and Abby, who are now no longer children.
My father has left this world, but Mom and my brothers Len and Rob remain
a vital presence in my life. I dedicate this book to my family, new and old, here
and departed.
I would like to thank several people for their concrete contributions to this
new edition. Michael Alvin, Omar Amin, Emily Barker, and Jack Zheng were
critical to building the website infrastructure and dealing with a variety of
manuscript preparation issues. Their roles were played by Ricky Bradley, An-
drew Gaun, Zhong Li, Betson Thomas, and Dario Vlah on previous editions.
The world’s most careful reader, Robert Piché of Tampere University, and Stony
Brook students Peter Duffy, Olesia Elfimova, and Robert Matsibekker read early
versions of this edition, and saved both you and me the trouble of dealing with
many errata. Thanks also to my Springer-Verlag editors, Wayne Wheeler and
Simon Rees.
Several exercises were originated by colleagues or inspired by other texts.
Reconstructing the original sources years later can be challenging, but credits
for each problem (to the best of my recollection) appear on the website.
Much of what I know about algorithms I learned along with my graduate stu-
dents. Several of them (Yaw-Ling Lin, Sundaram Gopalakrishnan, Ting Chen,
Francine Evans, Harald Rau, Ricky Bradley, and Dimitris Margaritis) are the
real heroes of the war stories related within. My Stony Brook friends and algo-
rithm colleagues Estie Arkin, Michael Bender, Jing Chen, Rezaul Chowdhury,
Jie Gao, Joe Mitchell, and Rob Patro have always been a pleasure to work with.
Caveat
It is traditional for the author to magnanimously accept the blame for whatever
deficiencies remain. I don’t. Any errors, deficiencies, or problems in this book
are somebody else’s fault, but I would appreciate knowing about them so as to
determine who is to blame.
Steven S. Skiena
Department of Computer Science
Stony Brook University
Stony Brook, NY 11794-2424
http://www.cs.stonybrook.edu/~skiena
August 2020
Contents
2 Algorithm Analysis 31
2.1 The RAM Model of Computation . . . . . . . . . . . . . . . . . . 31
2.1.1 Best-Case, Worst-Case, and Average-Case Complexity . . 32
2.2 The Big Oh Notation . . . . . . . . . . . . . . . . . . . . . . . . . 34
2.3 Growth Rates and Dominance Relations . . . . . . . . . . . . . . 37
2.3.1 Dominance Relations . . . . . . . . . . . . . . . . . . . . . 38
2.4 Working with the Big Oh . . . . . . . . . . . . . . . . . . . . . . 39
2.4.1 Adding Functions . . . . . . . . . . . . . . . . . . . . . . . 40
2.4.2 Multiplying Functions . . . . . . . . . . . . . . . . . . . . 40
2.5 Reasoning about Efficiency . . . . . . . . . . . . . . . . . . . . . 41
2.5.1 Selection Sort . . . . . . . . . . . . . . . . . . . . . . . . . 41
2.5.2 Insertion Sort . . . . . . . . . . . . . . . . . . . . . . . . . 42
2.5.3 String Pattern Matching . . . . . . . . . . . . . . . . . . . 43
2.5.4 Matrix Multiplication . . . . . . . . . . . . . . . . . . . . 45
2.6 Summations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
2.7 Logarithms and Their Applications . . . . . . . . . . . . . . . . . 48
ix
x CONTENTS
3 Data Structures 69
3.1 Contiguous vs. Linked Data Structures . . . . . . . . . . . . . . . 69
3.1.1 Arrays . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70
3.1.2 Pointers and Linked Structures . . . . . . . . . . . . . . . 71
3.1.3 Comparison . . . . . . . . . . . . . . . . . . . . . . . . . . 74
3.2 Containers: Stacks and Queues . . . . . . . . . . . . . . . . . . . 75
3.3 Dictionaries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76
3.4 Binary Search Trees . . . . . . . . . . . . . . . . . . . . . . . . . 81
3.4.1 Implementing Binary Search Trees . . . . . . . . . . . . . 81
3.4.2 How Good are Binary Search Trees? . . . . . . . . . . . . 85
3.4.3 Balanced Search Trees . . . . . . . . . . . . . . . . . . . . 86
3.5 Priority Queues . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87
3.6 War Story: Stripping Triangulations . . . . . . . . . . . . . . . . 89
3.7 Hashing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93
3.7.1 Collision Resolution . . . . . . . . . . . . . . . . . . . . . 93
3.7.2 Duplicate Detection via Hashing . . . . . . . . . . . . . . 95
3.7.3 Other Hashing Tricks . . . . . . . . . . . . . . . . . . . . 96
3.7.4 Canonicalization . . . . . . . . . . . . . . . . . . . . . . . 96
3.7.5 Compaction . . . . . . . . . . . . . . . . . . . . . . . . . . 97
3.8 Specialized Data Structures . . . . . . . . . . . . . . . . . . . . . 98
3.9 War Story: String ’em Up . . . . . . . . . . . . . . . . . . . . . . 98
3.10 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103
4 Sorting 109
4.1 Applications of Sorting . . . . . . . . . . . . . . . . . . . . . . . . 109
4.2 Pragmatics of Sorting . . . . . . . . . . . . . . . . . . . . . . . . 113
4.3 Heapsort: Fast Sorting via Data Structures . . . . . . . . . . . . 115
4.3.1 Heaps . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116
4.3.2 Constructing Heaps . . . . . . . . . . . . . . . . . . . . . 118
4.3.3 Extracting the Minimum . . . . . . . . . . . . . . . . . . 120
4.3.4 Faster Heap Construction (*) . . . . . . . . . . . . . . . . 122
4.3.5 Sorting by Incremental Insertion . . . . . . . . . . . . . . 124
CONTENTS xi
11 NP-Completeness 355
11.1 Problems and Reductions . . . . . . . . . . . . . . . . . . . . . . 355
11.1.1 The Key Idea . . . . . . . . . . . . . . . . . . . . . . . . . 356
11.1.2 Decision Problems . . . . . . . . . . . . . . . . . . . . . . 357
11.2 Reductions for Algorithms . . . . . . . . . . . . . . . . . . . . . . 358
11.2.1 Closest Pair . . . . . . . . . . . . . . . . . . . . . . . . . . 358
11.2.2 Longest Increasing Subsequence . . . . . . . . . . . . . . . 359
11.2.3 Least Common Multiple . . . . . . . . . . . . . . . . . . . 359
11.2.4 Convex Hull (*) . . . . . . . . . . . . . . . . . . . . . . . 360
11.3 Elementary Hardness Reductions . . . . . . . . . . . . . . . . . . 361
xiv CONTENTS
23 Bibliography 719
Index 769
Part I
Introduction to Algorithm
Design
Problem: Sorting
Input: A sequence of n keys a1 , . . . , an .
Output: The permutation (reordering) of the input sequence such that a1 ≤
a2 ≤ · · · ≤ an−1 ≤ an .
© The Editor(s) (if applicable) and The Author(s), under exclusive license to 3
Springer Nature Switzerland AG 2020
S. S. Skiena, The Algorithm Design Manual, Texts in Computer Science,
https://doi.org/10.1007/978-3-030-54256-6_1
4 CHAPTER 1. INTRODUCTION TO ALGORITHM DESIGN
I N S E R T I O N S O R T
I N S E R T I O N S O R T
I NS E R T I O N S O R T
E I N S R T I O N S O R T
E I N R S T I O N S O R T
E I N R S T IO N S O R T
E I I N R STO N S O R T
E I I N O RST N S O R T
E I I N N OR S T S O R T
E I I N N OR S S T OR T
E I I N N OOR S S T RT
E I I N N OOR R S S T T
E I I N N OO R R S S T T
0 0
8 1
7
2
3
5 4
Figure 1.2: A good instance for the nearest-neighbor heuristic. The rainbow
coloring (red to violet) reflects the order of incorporation.
You are given the job of programming the robot arm. Stop right now and
think up an algorithm to solve this problem. I’ll be happy to wait for you. . .
Several algorithms might come to mind to solve this problem. Perhaps the
most popular idea is the nearest-neighbor heuristic. Starting from some point
p0 , we walk first to its nearest neighbor p1 . From p1 , we walk to its nearest
unvisited neighbor, thus excluding only p0 as a candidate. We now repeat this
process until we run out of unvisited points, after which we return to p0 to close
off the tour. Written in pseudo-code, the nearest-neighbor heuristic looks like
6 CHAPTER 1. INTRODUCTION TO ALGORITHM DESIGN
−21 −5 −1 0 1 3 11
−21 −5 −1 0 1 3 11
Figure 1.3: A bad instance for the nearest-neighbor heuristic, with the optimal
solution. Colors are sequenced as ordered in the rainbow.
this:
NearestNeighbor(P )
Pick and visit an initial point p0 from P
p = p0
i=0
While there are still unvisited points
i=i+1
Select pi to be the closest unvisited point to pi−1
Visit pi
Return to p0 from pn−1
This algorithm has a lot to recommend it. It is simple to understand and
implement. It makes sense to visit nearby points before we visit faraway points
to reduce the total travel time. The algorithm works perfectly on the example
in Figure 1.2. The nearest-neighbor rule is reasonably efficient, for it looks at
each pair of points (pi , pj ) at most twice: once when adding pi to the tour, the
other when adding pj . Against all these positives there is only one problem.
This algorithm is completely wrong.
Wrong? How can it be wrong? The algorithm always finds a tour, but it
doesn’t necessarily find the shortest possible tour. It doesn’t necessarily even
come close. Consider the set of points in Figure 1.3, all of which lie along a line.
The numbers describe the distance that each point lies to the left or right of
the point labeled “0”. When we start from the point “0” and repeatedly walk
to the nearest unvisited neighbor, we might keep jumping left–right–left–right
over “0” as the algorithm offers no advice on how to break ties. A much better
(indeed optimal) tour for these points starts from the left-most point and visits
each point as we walk right before returning at the left-most point.
Try now to imagine your boss’s delight as she watches a demo of your robot
arm hopscotching left–right–left–right during the assembly of such a simple
board.
1.1. ROBOT TOUR OPTIMIZATION 7
“But wait,” you might be saying. “The problem was in starting at point
“0.” Instead, why don’t we start the nearest-neighbor rule using the left-most
point as the initial point p0 ? By doing this, we will find the optimal solution
on this instance.”
That is 100% true, at least until we rotate our example by 90 degrees. Now
all points are equally left-most. If the point “0” were moved just slightly to the
left, it would be picked as the starting point. Now the robot arm will hopscotch
up–down–up–down instead of left–right–left–right, but the travel time will be
just as bad as before. No matter what you do to pick the first point, the
nearest-neighbor rule is doomed to work incorrectly on certain point sets.
Maybe what we need is a different approach. Always walking to the closest
point is too restrictive, since that seems to trap us into making moves we didn’t
want. A different idea might repeatedly connect the closest pair of endpoints
whose connection will not create a problem, such as premature termination of
the cycle. Each vertex begins as its own single vertex chain. After merging
everything together, we will end up with a single chain containing all the points
in it. Connecting the final two endpoints gives us a cycle. At any step during
the execution of this closest-pair heuristic, we will have a set of single vertices
and the end of vertex-disjoint chains available to merge. In pseudocode:
ClosestPair(P )
Let n be the number of points in set P .
For i = 1 to n − 1 do
d=∞
For each pair of endpoints (s, t) from distinct vertex chains
if dist(s, t) ≤ d then sm = s, tm = t, and d = dist(s, t)
Connect (sm , tm ) by an edge
Connect the two endpoints by an edge
This closest-pair rule does the right thing in the example in Figure 1.3.
It starts by connecting “0” to its two immediate neighbors, the points 1 and
−1. Subsequently, the next closest pair will alternate left–right, growing the
central path by one link at a time. The closest-pair heuristic is somewhat more
complicated and less efficient than the previous one, but at least it gives the
right answer in this example.
But not on all examples. Consider what this algorithm does on the point set
in Figure 1.4(l). It consists of two rows of equally spaced points, with the rows
slightly closer together (distance 1 − ) than the neighboring points are spaced
within each row (distance 1 + ). Thus, the closest pairs of points stretch across
the gap, not around the boundary. After we pair off these points, the closest re-
maining pairs will connect these pairs alternately around the boundary. The to-
tal path length of the closest-pair tour is 3(1−)+2(1+)+ (1 − )2 + (2 + 2)2 .
Compared to the tour shown in Figure 1.4(r), we travel over 20% farther than
necessary when → 0. Examples exist where the penalty is considerably worse
than this.
Thus, this second algorithm is also wrong. Which one of these algorithms
8 CHAPTER 1. INTRODUCTION TO ALGORITHM DESIGN
1+ε 1+ε
1+ε 1+ε
(l) (r)
Figure 1.4: A bad instance for the closest-pair heuristic, with the optimal solu-
tion.
performs better? You can’t tell just by looking at them. Clearly, both heuristics
can end up with very bad tours on innocent-looking input.
At this point, you might wonder what a correct algorithm for our problem
looks like. Well, we could try enumerating all possible orderings of the set of
points, and then select the one that minimizes the total length:
OptimalTSP(P )
d=∞
For each of the n! permutations Pi of point set P
If (cost(Pi ) ≤ d) then d = cost(Pi ) and Pmin = Pi
Return Pmin
day of filming. Whenever you accept a job, you must commit to being available
throughout this entire period. Thus, you cannot accept two jobs whose intervals
overlap.
For an artist such as yourself, the criterion for job acceptance is clear: you
want to make as much money as possible. Because each film pays the same fee,
this implies you seek the largest possible set of jobs (intervals) such that no two
of them conflict with each other.
For example, consider the available projects in Figure 1.5. You can star in
at most four films, namely “Discrete” Mathematics, Programming Challenges,
Calculated Bets, and one of either Halting State or Steiner’s Tree.
You (or your agent) must solve the following algorithmic scheduling problem:
Problem: Movie Scheduling Problem
Input: A set I of n intervals on the line.
Output: What is the largest subset of mutually non-overlapping intervals that
can be selected from I?
Now you (the algorist) are given the job of developing a scheduling algorithm
for this task. Stop right now and try to find one. Again, I’ll be happy to wait. . .
There are several ideas that may come to mind. One is based on the notion
that it is best to work whenever work is available. This implies that you should
start with the job with the earliest start date – after all, there is no other job
you can work on then, at least during the beginning of this period:
EarliestJobFirst(I)
Accept the earliest starting job j from I that does not overlap any
previously accepted job, and repeat until no more such jobs remain.
This idea makes sense, at least until we realize that accepting the earliest
job might block us from taking many other jobs if that first job is long. Check
out Figure 1.6(l), where the epic War and Peace is both the first job available
and long enough to kill off all other prospects.
This bad example naturally suggests another idea. The problem with War
and Peace is that it is too long. Perhaps we should instead start by taking
the shortest job, and keep seeking the shortest available job at every turn.
Maximizing the number of jobs we do in a given period is clearly connected to
the notion of banging them out as quickly as possible. This yields the heuristic:
10 CHAPTER 1. INTRODUCTION TO ALGORITHM DESIGN
(l) (r)
Figure 1.6: Bad instances for the (l) earliest job first and (r) shortest job first
heuristics. The optimal solutions are in red.
ShortestJobFirst(I)
While (I = ∅) do
Accept the shortest possible job j from I.
Delete j, and any interval that intersects j, from I.
Again this idea makes sense, at least until we realize that accepting the
shortest job might block us from taking two other jobs, as shown in Figure
1.6(r). While the maximum potential loss here seems smaller than with the
previous heuristic, it can still limit us to half the optimal payoff.
At this point, an algorithm where we try all possibilities may start to look
good. As with the TSP problem, we can be certain exhaustive search is correct.
If we ignore the details of testing whether a set of intervals are in fact disjoint,
it looks something like this:
ExhaustiveScheduling(I)
j=0
Smax = ∅
For each of the 2n subsets Si of intervals I
If (Si is mutually non-overlapping) and (size(Si ) > j)
then j = size(Si ) and Smax = Si .
Return Smax
But how slow is it? The key limitation is enumerating the 2n subsets of
n things. The good news is that this is much better than enumerating all n!
orders of n things, as proposed for the robot tour optimization problem. There
are only about one million subsets when n = 20, which can be enumerated
within seconds on a decent computer. However, when fed n = 100 movies, we
get 2100 subsets, which is much much greater than the 20! that made our robot
cry “uncle” in the previous problem.
The difference between our scheduling and robotics problems is that there is
an algorithm that solves movie scheduling both correctly and efficiently. Think
about the first job to terminate—that is, the interval x whose right endpoint
is left-most among all intervals. This role is played by “Discrete” Mathematics
in Figure 1.5. Other jobs may well have started before x, but all of these must
at least partially overlap each other. Thus, we can select at most one from the
group. The first of these jobs to terminate is x, so any of the overlapping jobs
potentially block out other opportunities to the right of it. Clearly we can never
lose by picking x. This suggests the following correct, efficient algorithm:
1.3. REASONING ABOUT CORRECTNESS 11
OptimalScheduling(I)
While (I = ∅) do
Accept the job j from I with the earliest completion date.
Delete j, and any interval which intersects j, from I.
Ensuring the optimal answer over all possible inputs is a difficult but often
achievable goal. Seeking counterexamples that break pretender algorithms is an
important part of the algorithm design process. Efficient algorithms are often
lurking out there; this book will develop your skills to help you find them.
in August and October). The earliest completion algorithm would not work for
such a generalized scheduling problem. Indeed, no efficient algorithm exists for
this generalized problem, as we will see in Section 11.3.2.
B
Y the ruse in which Cormorin had instructed me, and for which he
had furnished the funds, I had provided against any exposure.
By this time I was fully satisfied that my uncle was working
against me; not that he intended to ruin me, but only to
maintain his own power and influence over me. There are men of this
stamp in the world, who will punish their best friends when they
refuse to be guided by them. Captain Halliard was as jealous of his
influence as he was of his money.
As my account with the bank was now square, I had no fear of the
investigation which was in progress. Mr. Heavyside, who had never
been suspected of even an irregularity, had been so kind as to inform
me of the proposed examination. I had in him a good friend, and a
mortgage on his future fidelity to me. I should defeat my uncle this
time, as I had before, but it was annoying to be subjected to his
espionage, though I could not afford to have a serious quarrel with
him.
I went home at about the usual hour. My Bustumups had done so
well that I was tolerably light-hearted. Lilian was as joyous as a
dream in June. Bertha had been with her all the forenoon, and I
heard much in praise of Tom Flynn. We dined, and then I proposed to
Lilian that we should ride out into the country. She was glad to go,
and we went. On my return home at six o’clock, Biddy handed me a
note from Mr. Bristlebach. I recognized his heavy hand-writing, and
my blood ceased to flow in its channels. I tore open the envelope. It
was simply a request to appear at the bank immediately.
What could it mean? My cash was all right. They could not have
discovered the truth. That was simply impossible. If there was any
trouble at the present time, Cormorin, and not myself, would be the
sufferer. If there had been a discovery of the whole truth, Mr.
Bristlebach was not the man to have sent a note to me; he would
have sent a constable. I decided to go at once to the bank, for I was
satisfied, from the manner in which the message had come, and by
the assurance that my cash was all right, that nothing very serious
could be charged upon me. I told Lilian I was going down town for an
hour, and she did not bother me with any troublesome questions.
On my arrival at the bank I found the president and my uncle in
the directors’ room. Both of them looked severe, but Captain Halliard
did not seem to be so much at his ease as usual. I knew him well
enough to be able to read his thoughts, and whatever mischief was
brewing he was at the bottom of it.
“Mr. Glasswood, of course you are aware that There is a deficiency
in your account?” said Mr. Bristlebach.
“No, sir, I am not aware of it,” I replied; and as I spoke the literal
truth, I answered with confidence.
“You are not?”
“No, sir.”
“Did you balance your cash to-day?”
“I did, sir; and at half-past two it was all right.”
“You put a bold face on the matter.”
“Certainly I do, sir. I am innocent of the charge, and I can afford
to speak the truth.”
“Nevertheless, your cash is short.”
“It was not short at half-past two to-day,” I replied, glancing at my
uncle.
He was uneasy, and did not confront me when I gazed at him.
“It is not a large deficiency,” added Mr. Bristlebach, “but large
enough to demand inquiry.”
“May I ask how much you found it short,” I inquired.
“Only three hundred dollars.”
“There may be some mistake—I hope there is,” suggested my
uncle.
“Who counted the cash?” I asked.
“We counted it together,” replied the president. “I wish to add that
I do not regard you as a defaulter or any thing of that sort. I sent for
you to enable you to explain the matter.”
“I have no further explanation to make. I left my cash all right to-
day,” I added, confidently.
“He is so sure, that I rather think some mistake has been made,”
added Captain Halliard.
“Probably there has been. Mr. Glasswood, I have had the utmost
confidence in you. When I suspected you before, a second
examination convinced me of your integrity. I have no doubt it will be
so this time.”
“I cannot undertake to keep my cash right, if other persons are
allowed to go to my drawer,” I continued, rather savagely.
“What!” exclaimed my uncle, springing to his feet.
“I said what I meant to say,” I replied.
The remark hit just where I intended it should. Mr. Bristlebach and
my uncle had been counting my cash. I had left it all right. If the
deficiency was insignificant, it was still enough to ruin me. I had
already made up my mind how my cash happened to be short. If the
president had made the examination himself there would have been
no deficiency. Of course I mean to say that Captain Halliard himself
had been the author of the mischief. In other words, he had either
taken three hundred dollars from my cash, or had falsely reported his
count.
Before I ventured to make this violent statement, I put my uncle
fairly on trial, and called up all the circumstances of our present
relations to testify against him. He was determined to maintain his
influence over me, and to prevent me from saying any thing to Aunt
Rachel about him. I had refused to give up my house at his bidding,
and prevented him from obliging his friend, Mr. Brentbone. I had
roundly reproached him for his conduct to me, and used language
which he could not tolerate in any one. I was satisfied that he had a
strong motive for desiring to obtain a hold upon me.
A strong motive, however, is not sufficient to explain so dastardly
an act as that in which I had dared to implicate my uncle. A man of
integrity, simply an honest man, would not be guilty of so vile a deed.
Was my uncle capable of such an act? He had procured my situation
for me by bringing up a charge against Tom Flynn which both he and
I knew was false—one which he himself had disproved as soon as his
purpose was accomplished. If he would do one mean thing, he would
not halt at another.
He had compelled me to pay the thousand dollars I owed Aunt
Rachel, out of sheer malice, and only to put me in a position where
he could control me. The mild speech of the president of the bank
assured me that I was not to be harshly dealt with; and my uncle
gently suggested that there might be a mistake.
“Be careful what you say, Mr. Glasswood,” said the president.
“Now I’m going out to get a cup of tea; when I come back we will
ascertain whether there is a mistake or not.”
Mr. Bristlebach left the room. My uncle looked embarrassed, thrust
his fingers into his vest pockets, and seemed to be feeling for
something. I was tempted to spring upon him, and throw out the
contents of those pockets, for I was satisfied that the deficiency in my
cash could be accounted for only in that way.
“Paley, you have been speculating in coppers,” said he.
“I have; but that is my business,” I replied, roughly.
“I propose to pay the bank the amount your cash is short, and to
hush the matter up where it is.”
“I don’t ask you to do any thing of the sort.”
“I am on your bond, and I must do it. No matter about that. I
expected, after you told me what you were doing in coppers, to find a
deficit of thousands. I was prepared to pay even that, for you are of
my own flesh and blood.”
“You are very affectionate!”
“I have succeeded in quieting Mr. Bristlebach.”
“I see you have.”
“You talk to me as though I had done you an injury instead of a
kindness,” added he, reproachfully.
“That is what you have done.”
“Your cash is three hundred short,” said he, putting his hands into
his vest pockets again.
Perhaps I was insane under the pressure of his implied charge; at
any rate, under the impulse of the moment, without consciously
determining to do it, I sprung upon him like a tiger; and having no
warning of my purpose myself, I gave him none. I thrust my hands
into his vest pockets, and drew from them whatever they contained. I
retreated into the farther corner of the room to examine my capture.
The deed was done so quick that Captain Halliard had no time to
resist, though he seized me by the shoulders. I was furious, and
shook him off like a child.
“What do you mean, you villain?” gasped he.
I paid no attention to him, but proceeded to examine my prize.
Among other things I found three bills, of one hundred dollars each.
“Do you mean to rob me, Paley?” demanded he; but, like Hamlet’s
ghost, he appeared to be “more in sorrow than in anger;” and more
in fear than in sorrow.
“Do you carry your money in your vest pockets, sir?” I demanded.
“Sometimes I do.”
“You took these bills from my trunk when you counted my cash.”
“Nonsense, Paley!”
“I can swear to one of them, at least,” I replied, holding up one of
the bills, on the face of which some clown had written a sentence
about depreciated currency, that had attracted my attention. “I left
this bill in my trunk in the vault at half-past two to-day; at half-past
six I find it in your pocket.”
“Do you think—”
“I know!” I interrupted, him, in the most savage manner. “If I can
find a policeman, I will put you on the track to the State Prison.”
“Don’t be absurd, Paley,” interposed my uncle; but I saw that
there was no heart in the remark. “There must have been a mistake
in the counting.”
“You stole this money from my trunk to get me into trouble.”
“Didn’t I tell the president that I would pay the deficit?” asked my
uncle. “Hush up! There comes Mr. Bristlebach! Not a word of this to
him.”
“You confess, then, that you took this money from my trunk?”
“By-and-by we will talk about it,” he replied, with much agitation.
I had proved my case. My uncle was a villain. He had taken three
hundred dollars from my cash—not enough to make me look like a
defaulter—for the purpose of maintaining his influence over me, and
to keep me from telling bad stories about him to Aunt Rachel. Guilty
as I was, I made myself believe that I was an innocent man, because
I was not guilty in the direction he accused me. Mr. Bristlebach
returned to the room.
“I am satisfied, from what Mr. Glasswood says, that there must
have been a mistake in our count,” said my uncle. “As I told you, I
was confident my nephew was honest, but I was fearful, when I
learned that he had been speculating in coppers. I thought, as I was
on his bond, we had better look into the matter. I am perfectly
satisfied now.”
This very consistent statement was assented to by the president,
but my cash was counted again, at the request of Captain Halliard. I
was in doubt whether to restore the three hundred I had wrested
from the conspirator, but I concluded that I could not afford to expose
him. We counted the cash, which was mostly in large bills, and of
course I was fully vindicated. The president was profuse in his
apologies, and my uncle was kind enough to take the burden of the
blunder on himself. He could even see where he had made the
mistake. I left the bank with him, and we walked up the street
together.
“That was an awkward mistake of mine,” said he.
“Very,” I replied, with a sneer.
“But I think I can explain it.”
“I don’t think you can.”
“You seem to have taken it into your head that I mean to injure
you.”
“I have.”
“You are mistaken. I am on your bond. Money is so plenty with
you, that I was afraid I might be called upon to pay the bond.
Bristlebach is so intimate with me that I could satisfy myself without
doing you any harm. That was all I intended.”
“And that’s the reason why you took three hundred dollars out of
my trunk, I suppose?”
“Mr. Bristlebach handed me that money himself. I wanted to pay
out that amount to-night, and I drew a check for it. I entirely forgot it
when we counted the cash, and that was the deficit. Here is the
check; as you put the money back, I took the check from your
drawer. That’s the whole story.”
“Why didn’t you explain it to Mr. Bristlebach, then?” I asked,
believing not a word he said.
“Because it was so stupid of me to forget that the check had been
paid out of your cash.”
“Very stupid, indeed!”
“I will tell him about it to-morrow,” added my uncle.
As I have said before, a man in my situation could not afford to
quarrel with one so powerful as Captain Halliard. I kept my own
counsel, not wholly certain that he would not yet be called upon to
pay the amount of his bond on my account. We parted in peace, and
I was abundantly pleased that I had been able to fight off the charge.
The next morning, when I went to the bank, I took the eight
thousand from the cash, which Cormorin had lent me, and returned it
to him. He was a happy man then. I doubt whether he slept a wink
the night before, for the idea of being responsible for my deficit, as
well as his own, could not have been very comforting to him.
I was all right at the bank, and my uncle treated me with
“distinguished consideration.” On several occasions he assured me he
should use his influence in my favor with Aunt Rachel. If I wished for
the money he had compelled me to pay—solely for my own good—he
would let me have it again. Indeed, if I was short at any time, he
would lend me a thousand dollars. I thought I might have occasion to
avail myself of his offer, and I was pleasant and pliable. I said nothing
more about the three hundred dollars.
For a week all was well with me. Ballyhacks went up to seventy-
five; but Bustumups were slower, and had only touched forty in the
same time. This figure satisfied me, inasmuch as it enabled me to pay
my debt at the bank. Yet I believed, with the utmost confidence, that
there was five or ten thousand more in the stock for me, and as long
as things were easy at the bank, I did not think of realizing.
Then I was sick for ten days, and was obliged to stay in the
house, but even while my brain was on fire with fever I went down
town one day. I dared not leave my deficit to be discovered by my
substitute. I compelled poor Cormorin to lend me the eight thousand
again, on the security of my Bustumups. They were worth nearly this
sum in the market by this time, and he did not object very
strenuously.
As soon as I was able to get out, I hastened back to the bank,
and took my place at the counter. Cormorin had sold his stock at
eighty. Bustumups were quoted at fifty, with a prospect of a further
advance. My friend had made thirteen thousand dollars. When I had
made him whole, he instantly resigned his place, fearful, I think, of
getting into trouble through my agency. He went to New York, to go
into business there. I did not care. My stocks at fifty paid my debt,
and left me forty-five hundred surplus. I was excited over the
prospect. I should be a rich man in a few weeks.
But everything did not turn out just as I anticipated.
CHAPTER XIX.
A CRASH IN COPPERS.
I
WAS worth forty-five hundred dollars while Bustumups were
quoted at fifty. Every day, while they hung at about this figure,
I debated with myself the policy of selling, paying my debt, and
investing my surplus in some other concern. Perhaps I should
have done so, if I had known of a company in which I could place
entire confidence. I missed Cormorin very much, for I needed his
advice; and I had come to regard him as an oracle in the matter of
coppers.
It looked like madness to sacrifice a stock which might go up to
eighty or a hundred, as the Ballyhack had, and though my debt
worried me, I could not make up my mind to let it go. If I could put
ten thousand dollars in my pocket, my fortune would be made, for
with this sum I could operate on a large scale. There was no danger
of another examination of my cash at present, and I was secure. But
Bustumups did not advance as rapidly as I wished. They hung at
about fifty. I was told that parties were investigating the condition of
the mine, and that as soon as they reported, the stock would go up
as rapidly as Ballyhack had done. I was willing to wait patiently for a
week or two, while the stock about held its own. Its trifling
fluctuations up and down troubled me, but the parties who worked it
convinced me that these were only accidental changes.
Though I saw my uncle every day, he did not allude to his own
villainy, and I was prudent enough to wait until I was out of the
woods before I did so. In the course of a couple of weeks, when I
had made my ten thousand dollars, I intended to resign my position,
and then I could afford to express my mind very freely to Captain
Halliard. With ten thousand dollars in my exchequer, I could go into
any business that suited me, and make money enough to support
me in a style becoming my abilities.
I still had strong hopes that the fortune of Aunt Rachel would be
mine. She was now apparently rapidly regaining her health, and I
determined to improve my chances as soon as I could. On the
following Saturday afternoon I took Lilian down to Springhaven with
me, and we both used our best efforts to win her regard. I took her
out to ride, I read to her, and the old lady seemed as fond of me as
when I was a boy. I was her only nephew, and it had been often
reported that I was to be her heir, though on what authority I did
not know. I invited her to spend a week or a month at my house in
Boston, and she promised to do so as soon as she was able.
A rumor that the parties who were investigating the condition of
the mine intended to make a favorable report sent Bustumups to
fifty-five, and I was very happy. I was worth nearly six thousand
dollars. At the end of another week the stock went up to sixty, and
the balance of worldly wealth in my favor was seven thousand
dollars. The game was becoming intensely exciting. Another week or
so would realize all my hopes. I should be free and safe.
While every thing was in this cheerful condition Aunt Rachel sent
for me, and I hastened to Springhaven, for I could not afford to
neglect her summons. She was ready to go home with me, and she
accompanied me to my house in Needham street. The old lady was
a little surprised to find that I lived in elegant style, as she was
pleased to express it; but then she regarded the salary I received,
which was double what her minister had, as princely in itself. Simple
as were her views of social economy, she did not accuse me of
extravagance. Lilian understood the matter perfectly, and was all
tenderness and devotion.
One morning, after she had been at our house three days, Aunt
Rachel asked me if I knew a certain Squire Townsend, a lawyer,
whom the old lady had been acquainted with in the early years of
her life. I had heard of him. He was an attorney of the old school,
and I hoped she intended to make her will while she was thus kindly
disposed towards me. She begged me to see the old gentleman, and
ask him to call upon her during the forenoon.
“Do you see much of Captain Halliard, Paley?” asked my aunt, as
I was going out.
“I see him nearly every day.”
“I wonder he has not been up to see me yet,” added the old lady.
I did not wonder. I had not taken the trouble to tell him that Aunt
Rachel was at my house.
“Do you wish to see him?” I asked.
“Not particularly. He has done considerable business for me.”
“I know it. He did some for you while you were sick.”
“Did he?”
“He made me pay the thousand dollars I borrowed of you.”
“What, Captain Halliard!” exclaimed the old lady.
“He did.”
“Why, I didn’t tell him to do that.”
“I know you didn’t, but he showed me a power of attorney from
you, and I couldn’t have helped myself if I had wished to do so; but
I paid it, and it’s of no consequence now.”
“I didn’t mean you should pay that money. I shouldn’t have cried
if you had never paid it. I’ll talk with Squire Townsend about it.
Couldn’t you take care of my property for me just as well as your
uncle?”
“Well, I suppose I could,” I replied, rather indifferently.
“I never liked your uncle very well. He is too sharp for me. I’ll see
what can be done.”
“I wouldn’t say anything about meddling with Captain Halliard, at
present,” I suggested, for I was somewhat afraid of him myself.
“I’ll see about it; but I didn’t mean he should trouble you about
that money. He’d no business to do it, and I shall tell him so when I
see him.”
I did not intend she should see him at present. I went to the
office of Squire Townsend, on my way down town, and left a
message for him to call upon my aunt. I was fully persuaded in my
own mind that she intended to make a will, and that she had come
up to Boston in order to have the instrument drawn up by her old
friend. Every thing looked rosy to me, for the old lady would
certainly leave me the larger portion, if not the whole, of her worldly
wealth.
When I went home in the afternoon I learned that Squire
Townsend had spent a couple of hours with Aunt Rachel, but Lilian
had not heard a word that passed between them. Then the squire
had called a carriage, and they had gone off together. I was not very
anxious to know where they had gone, though I concluded that it
was only to the office of her old friend for the purpose of having the
will properly signed and witnessed. Now, as always before, Aunt
Rachel kept her own counsel. She never told how much she was
worth, or what she intended to do with her property. She was true
to her antecedents, and during the remainder of her stay she never
mentioned the nature of her business with Squire Townsend, as she
invariably called him. She said a good deal about the worthy lawyer’s
history, and told stories about him at school. She was glad to meet
him once more before she left the world, but she did not hint that
she had special business with him.
The old lady staid her week out, and then said she must go
home. She did not think the city agreed with her. She did not sleep
as well nights as at Springhaven. Both Lilian and I pressed her to
remain longer, and promised to do every thing we could to make her
happy, but she was resolute, and I attended her home, a week to a
day from the time she arrived.
I never saw her again.
During the week that Aunt Rachel was with me, Bustumups
began to look a little shaky. From sixty the stock went down to fifty-
five in one day, but it immediately rallied, and those who managed it
assured me it was only because money was a little tight, and a
considerable portion of the stock had been forced upon the market.
I proposed to sell, as I had promised myself that I would on the first
appearance of a decline.
“Don’t do it,” said the operator. “Wait three days, and you can
take sixty, if not sixty-five, for your stock. If you crowd it upon the
market at once, you will drive it down, and cheat yourself out of
twelve hundred dollars.”
But it looks shaky,” I pleaded.
“The best stocks on the street go up and down by turns. Wait till
day after to-morrow, at least.”
I did wait, because I did not like to have twenty-five hundred
dollars taken out of my pocket at one swoop. Two days after, I was
in a fever of anxiety about my Bustumups. They had gone up and
down under the influence of various rumors, good and bad, and no
one could foresee the end. At noon Tom Flynn went out for his
lunch.
“The coppers are in a bad way,” said he, taking his place at the
counter on his return.
“What is the matter with them?” I inquired, with my heart in my
throat, for my very reputation rested upon the prosperity of the
coppers.
“Ballyhacks have dropped down from eighty to fifty,” added Tom.
“What?” I exclaimed.
“That’s what they say. Did you own any?”
“No, no; no Ballyhacks,” I replied, struggling to conceal my
emotion.
I had not told Tom I was speculating in coppers, and I think he
knew nothing about it, though he might have heard something of
the kind.
“Did you own any coppers?” he inquired, with a tone and look
that indicated the sympathy he felt for me.
“None of any consequence,” I replied.
I dared not talk with him about the matter lest I should expose
my emotion. With the stunning intelligence he had communicated to
me on my mind, it was simply impossible for me to discharge my
duties in the bank. I could hardly tell a hundred-dollar bill from a
thousand. I told the cashier that I was sick, and was fearful that I
should faint again if I did not get out in the air. He took my place,
and I staggered out into the street. There were people on the
sidewalk, but I could not see them. Every thing seemed to be
without form or shape. I was in a fearful agony of mind, and
dreaded lest I should drop senseless upon the pavement.
I went into a saloon and drank a glass of brandy. I sat down at
one of the little tables to gather up my shattered senses. Ruin stared
me in the face. If Ballyhacks had fallen from eighty to fifty, what
hope could there be for Bustumups? After all, the mischief might be
confined to this particular stock, and mine might be still on the top
of the wave. The brandy I had drank seemed to have no effect upon
me. I took another glass, and my courage began to rise a little. The
saloon was nearly filled with people, and there was a confused
jabber of tongues all around me. Men spoke to me, and called me by
name. I replied mechanically, but I could not have told a minute
later who had spoken to me.
“But they are a fraud,” said a gentleman, seating himself at the
table next to mine.
“Certainly they are,” replied the other. “The Ballyhack mine has
produced some copper; but they say there is not a particle of metal
on the Bustumup track—not an ounce! The managers of this affair
ought to be indicted and sent to the State Prison.”
“Merciful Heavens!” I ejaculated to myself, “I am ruined!”
“Ballyhack has gone down to forty within half an hour,” added
one of the gentlemen.
“I heard a man offer Bustumups just now for twenty, and people
laughed at him,” added the other. “I don’t believe they will bring
ten.”
“Probably not. There is not a dollar of value in them. The thing is
an unmitigated swindle.”
The whole of the savage truth was poured into my ears. A
moment later, I heard some one say that the managers of the
Bustumup Company had found it convenient to disappear. I was
almost a maniac. I cursed my folly because I had not sold my stock
when it began to look shaky. The villains who had comforted me and
made promises that I should sell at sixty were simply designing
knaves, who had fraudulently worked this stock up to sixty, while
there was not a penny of real value in it.
The first shock bore heavily upon me, but I soon recovered in
some measure from its effect. I went into the street, and inquired
for myself, in regard to the coppers. There were two or three
substantial companies which were actually producing metal and
paying handsome dividends. The other companies were swindles;
and Bustumup was the most egregious humbug of the whole. I tried
to get an offer for my stock, and found it would not bring a dollar a
share. Indeed, it could not be sold at any price. In a word, the five
thousand dollars I had borrowed from the bank was a total loss.
I will not attempt to describe the misery into which I was so
suddenly plunged. If I had sold my stock a week before, I might
have paid my debt and had five thousand dollars left. Now I was a
defaulter in the sum of eight thousand dollars. It was horrible to
think of. There was no possible way, that I could see, to escape the
consequences. What should I do?
I went back to the bank and told Mr. Heavyside that I was better.
I resumed my place at the counter, and did my work till the bank
closed, sustained by the brandy I had drank. I tried to devise some
plan by which I could conceal my deficit for a time. I could think of
nothing satisfactory. An examination of the affairs of the bank was
sure to betray me. I was tempted to commit suicide, as others have
done under the same pressure of guilt.
I thought of my wife, and my eyes filled with tears, as I pictured
the fall to which she would be subjected. It was ruin to her as well
as to me. What would she do, while I was thinking of her in my
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.
textbookfull.com