Algorithms Sequential Parallel A Unified Approach Electrical and Computer Engineering Series 2nd Edition Russ Miller download pdf
Algorithms Sequential Parallel A Unified Approach Electrical and Computer Engineering Series 2nd Edition Russ Miller download pdf
https://ebookultra.com/download/parallel-metaheuristics-a-new-class-
of-algorithms-1st-edition-enrique-alba/
https://ebookultra.com/download/basic-electrical-and-electronics-
engineering-2nd-edition-r-k-rajput/
https://ebookultra.com/download/engineering-thermodynamics-a-computer-
approach-si-units-version-third-edition-r-k-rajput/
Evolutionary computation a unified approach 1st Edition
Kenneth A. De Jong
https://ebookultra.com/download/evolutionary-computation-a-unified-
approach-1st-edition-kenneth-a-de-jong/
https://ebookultra.com/download/mechatronics-engineering-and-
electrical-engineering-1st-edition-ai-sheng/
https://ebookultra.com/download/partial-differential-equations-a-
unified-hilbert-space-approach-1st-edition-rainer-picard/
https://ebookultra.com/download/latent-variable-models-and-factor-
analysis-a-unified-approach-3rd-edition-david-j-bartholomew/
Algorithms Sequential Parallel A Unified Approach
Electrical and Computer Engineering Series 2nd Edition
Russ Miller Digital Instant Download
Author(s): Russ Miller, Laurence Boxer
ISBN(s): 1584504129
Edition: 2
File Details: PDF, 1.95 MB
Year: 2005
Language: english
Algorithms
Sequential and Parallel
LIMITED WARRANTY AND DISCLAIMER OF LIABILITY
CHARLES RIVER MEDIA, INC. (“CRM”) AND/OR ANYONE WHO HAS BEEN IN-
VOLVED IN THE WRITING, CREATION OR PRODUCTION OF THE ACCOMPANY-
ING CODE IN THE TEXTUAL MATERIAL IN THE BOOK, CANNOT AND DO NOT
WARRANT THE PERFORMANCE OR RESULTS THAT MAY BE OBTAINED BY USING
THE CONTENTS OF THE BOOK. THE AUTHOR AND PUBLISHER HAVE USED
THEIR BEST EFFORTS TO ENSURE THE ACCURACY AND FUNCTIONALITY OF
THE TEXTUAL MATERIAL AND PROGRAMS DESCRIBED HEREIN. WE HOWEVER,
MAKE NO WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, REGARDING THE
PERFORMANCE OF THESE PROGRAMS OR CONTENTS. THE BOOK IS SOLD “AS
IS” WITHOUT WARRANTY (EXCEPT FOR DEFECTIVE MATERIALS USED IN MAN-
UFACTURING THE BOOK OR DUE TO FAULTY WORKMANSHIP).
THE SOLE REMEDY IN THE EVENT OF A CLAIM OF ANY KIND IS EXPRESSLY LIM-
ITED TO REPLACEMENT OF THE BOOK, AND ONLY AT THE DISCRETION OF CRM.
Russ Miller
Laurence Boxer
The first edition of this book was previously published by: Pearson Education, Inc.
No part of this publication may be reproduced in any way, stored in a retrieval system of any type, or
transmitted by any means or media, electronic or mechanical, including, but not limited to, photocopy,
recording, or scanning, without prior permission in writing from the publisher.
Russ Miller and Laurence Boxer. Algorithms Sequential and Parallel: A Unified Approach, Second Edition.
ISBN: 1-58450-412-9
eISBN: 1-58450-652-0
All brand names and product names mentioned in this book are trademarks or service marks of their re-
spective companies. Any omission or misuse (of any kind) of service marks or trademarks should not be
regarded as intent to infringe on the property of others. The publisher recognizes and respects all marks
used by companies, manufacturers, and developers as a means to distinguish their products.
05 7 6 5 4 3 2 1
CHARLES RIVER MEDIA titles are available for site license or bulk purchase by institutions, user
groups, corporations, etc. For additional information, please contact the Special Sales Department at
781-740-0400.
To my wife, Celeste, and my children, Brian, Amanda,
and Melissa.
—Russ Miller
—Laurence Boxer
This page intentionally left blank
Contents
Preface xv
1 Asymptotic Analysis 2
Notation and Terminology 4
Asymptotic Notation 6
More Notation 9
Asymptotic Relationships 11
Asymptotic Analysis and Limits 12
Summations and Integrals 14
Rules for Analysis of Algorithms 21
Limitations of Asymptotic Analysis 27
Common Terminology 29
Summary 29
Chapter Notes 30
Exercises 30
vii
viii Contents
4 Combinational Circuits 74
Combinational Circuits and Sorting Networks 76
Sorting Networks 76
Bitonic Merge 80
BitonicSort 84
Summary 87
Chapter Notes 88
Exercises 88
5 Models of Computation 90
RAM (Random Access Machine) 92
PRAM (Parallel Random Access Machine) 94
Examples: Simple Algorithms 98
Fundamental Terminology 106
Distributed Memory versus Shared Memory 107
Distributed Address Space versus Shared Address Space 108
Interconnection Networks 108
Processor Organizations 109
Linear Array 110
Ring 118
Mesh 119
Tree 123
Pyramid 125
Mesh-of-trees 127
Hypercube 131
Contents ix
9 Divide-and-Conquer 200
MergeSort (Revisited) 202
RAM 202
Linear Array 203
Selection 205
RAM 206
Analysis of Running Time 209
Parallel Machines 210
QuickSort (Partition Sort) 211
Array Implementation 216
Analysis of QuickSort 221
Expected-Case Analysis of QuickSort 223
Improving QuickSort 226
Contents xi
Bibliography 368
Index 373
This page intentionally left blank
Preface
xv
xvi Preface
Overview of Chapters
Background material for the course is presented in Chapters 1, 2, and 3. Chapter 1
introduces the concept of asymptotic analysis. While the reader might have seen
some of this material in a course on data structures, we present this material in a
fair amount of detail. The reader who is uncomfortable with some of the funda-
mental material from a Freshman-level Calculus sequence might want to brush up
on notions such as limits, summations and integrals, and derivatives, as they natu-
rally arise in the presentation and application of asymptotic analysis. Chapter 2
focuses on fundamentals of induction and recursion. While many students have
seen this material in previous courses in computer science and/or mathematics, we
have found it important to review this material briefly and to provide the students
with a reference for performing the necessary review. In Chapter 3, we present the
Master Method, a very useful cookbook-type of system for evaluating recurrence
equations that are common in an algorithms-based setting.
Chapter 4 presents an overview of combinational circuits and sorting net-
works. This work is used to motivate the natural use of parallel models and to
demonstrate the blending of architectural and algorithmic approaches. In Chapter
5, we introduce fundamental models of computation, including the RAM (a formal
sequential architecture) and a variety of parallel models of computation. The par-
allel models introduced include the PRAM, mesh, hypercube, and the Coarse-
Grained Multicomputer, to name a few. In addition, Chapter 5 introduces
terminology such as shared-memory and distributed-memory.
Preface xvii
Recommended Use
This book has been successfully deployed in both elective and required courses,
with students typically ranging from juniors (3rd-year undergraduates) to 2nd-year
graduates. A student in a course using this book need not be advanced in a mathe-
matical sense, but should have a basic, fundamental, background.
Correspondence
Please feel free to contact the authors directly with any comments or criticisms
(constructive or otherwise) of this book. Russ Miller may be reached at
miller@buffalo.edu and Laurence Boxer may be reached at boxer@niagara.edu.
In addition, a Web site for the book can be found from http://www.cse.buffalo.
edu/pub/WWW/faculty/miller/research.htm. This Web site contains information
related to the book, including pointers to education-based pages, relevant parallel
computing links, and errata.
xviii Preface
Acknowledgments
The authors would like to thank several anonymous reviewers for providing
insightful comments, which have been used to improve the presentation of this
book. We would like to thank the students at SUNY-Buffalo who used early drafts
of this book in their classes and provided valuable feedback. We would like to
thank Ken Smith, a member of the technical support staff at SUNY-Buffalo, for
providing assistance with Wintel support. We would also like to thank our families
for providing us the support necessary to complete this time-consuming project.
2
e live in a digital-data-driven society that relies increasingly on simulation and
W modeling for discovery. Data is increasing at an astonishing rate, typically two
to three times the rate of increase of processing power and network bandwidth. Thus,
to compete in a knowledge-based economy, students must learn to collect, organize,
maintain, analyze, and visualize data efficiently and effectively.
A comprehensive study of algorithms includes the design, analysis, implementa-
tion, and experimental evaluation of algorithms that solve important problems. These
include enabling problems, such as sorting, searching, and transferring data; as well as
applications-oriented problems, such as retrieving a reservation record, forecasting the
weather, or determining the positions of atoms in a molecule to improve rational drug
design.
In this chapter, we introduce some basic tools and techniques that are required to
evaluate effectively both a theoretical and an experimental analysis of algorithms. It is
important to realize that without analysis, it is often difficult to justify the choice of one
algorithm over another or to justify the need for developing a new algorithm. Therefore,
a critical aspect of most advanced data structures or algorithms courses is the develop-
ment of techniques for estimating the resources (running time, disk space, memory, and
so forth) required for a given algorithm. As an aside, we should point out that a course
covering proofs of correctness for algorithms is also critical, because having fast algo-
rithms that produce incorrect results is not desirable. However, for pragmatic reasons,
nontrivial proofs of correctness are not covered in this text.
Throughout this book, we will focus on resources associated with a given algo-
rithm. Specifically, we will be concerned with quantities that include the number of
processors, the size of the memory, and the running time required of an algorithm. A
comparison of such quantities will allow for a reasonable comparison between algo-
rithms, typically resulting in an informed choice of an algorithm for a target application.
For example, such analyses will allow us to make a more informed decision on which
sorting algorithm to use on a sequential machine, given data with certain properties that
are maintained in certain data structures. We should point out that when computing
solutions to numerical problems, one must often consider the quality of the solution.
Although this topic is critical, we believe it is covered in a more comprehensive fashion
in “Numerical Methods” or “Computational Science” courses than is possible in a
course on algorithms. In fact, most of the algorithms we consider in this book can be
viewed as “nonnumerical” in nature.
3
4 Chapter 1 Asymptotic Analysis
In practice, it often turns out that we are more concerned with time than with
memory. This statement may surprise students thinking of relatively small home-
work projects that, once freed of infinite loops, begin printing results almost
immediately. However, many important applications require massive processing
of large data sets, requiring hours or even days of CPU time. Examples of these
applications are found in areas such as molecular modeling, weather forecasting,
image analysis, neural network training, and simulation. Aside from the dollar cost
of computer time, human impatience or serious deadlines can limit the use of such
applications. For example, it helps to have a weather forecast only if it is made
available in advance of the forecast period. By contrast, it is not uncommon to be
able to devise algorithms and their associated data structures such that the memory
requirements are quite reasonable, often no more than a small multiple of the size
of the data set being processed.
In this chapter, we develop mathematical tools for the analysis of resources
required by a computer algorithm. Because time is more often the subject of our
analysis than memory, we will use time-related terminology; however, the same
tools can naturally be applied to the analysis of memory requirements or error
tolerance.
algorithm, for large n (recall that n is typically the size of the data input
to the algorithm).
Growth Rate: Because asymptotic analysis implies that we are
interested in the general behavior of the function as the input parameter
gets large (we are interested in the behavior of T (n) as n q h ), this
implies that low-order terms can (and should) be dropped from the
expression. In fact, because we are interested in the growth rate of
the function as n gets large, we should also ignore constant factors
when expressing asymptotic analysis. This is not to say that these terms
are irrelevant in practice, just that they are irrelevant in terms of
considering the growth rate of a function. So, for example, we say that
the function 3n3 + 10n2 + n + 17 grows as n3. Consider another example:
as n gets large, would you prefer to use an algorithm with running time
95n2 + 405n + 1997 or one with a running time of 2n3 + 12? We hope
you chose the former, which has a growth rate of n2, as opposed to the
latter, which has a growth rate of n3. Naturally, though, if n were small,
one would prefer 2n3 + 12 to 95n2 + 405n + 1997. In fact, you should be
able to determine the value of n that is the breakeven point. Figure 1.1
presents an illustration of this situation.
y=g(n)
T(n)
y=f(n)
better
n0 n
Asymptotic Notation
At this point, we introduce some standard notation that is useful in expressing the
asymptotic behavior of a function. Because we often have a function that we wish
to express (more simply) in terms of another function, it is easiest to introduce this
terminology in terms of two functions. Suppose f and g are positive functions of n.
Then
f(n) = 6(g(n)) (read “f of n is theta of g of n”) if and only if there exist posi-
tive constants c1, c2, and n0 such that c1 g ( n) f f ( n) f c2 g ( n) whenever n v n0.
See Figure 1.2.
y = g(n)
y = f(n)
n0
y = g(n)
y = f(n)
y = f(n) y = g(n)
n0 n0
y=g(n)
y=Cg(n)
y=C'g(n)
y=f(n)
n(C) n(C')
f (n) = \(g(n)) (read “f of n is little omega of g of n”) if and only if for every
positive constant C there is a positive integer n0 such that f (n) > Cg(n)
whenever n v n0. See Figure 1.6.
8 Chapter 1 Asymptotic Analysis
y=f(n)
y=C'g(n)
y=Cg(n)
y=g(n)
n(C) n(C')
EXAMPLE
6
5
4
3
2
1
t
−2π −π π 2π 3π
More Notation
We will often find the floor and ceiling functions useful. Given a real number x,
there is a unique integer n such that
n f x < n + 1.
® x ½¾ = n.
n < x f n + 1.
¬ x ¼½ = n + 1.
x 1 < ® x ½¾ f x f ¬ x ¼½ < x + 1.
left = right
or
left o right
will mean “assign the value of right as the new value of left.”
EXAMPLE
Show that
( )
n
¨k p
= 6 n p+1
k =1
for p > 1, a fixed constant. First, we consider an upper bound on the summation.
We know that
n
¨k p
f n × np
k =1
( )
n
¨k p
= O n p+1 .
k =1
Next, we consider a lower bound on the sum. Notice that it is easy to derive a
trivial lower bound of <(n), because there are n terms in the summation, the
least of which is equal to 1. However, we can derive a more useful, larger, lower
bound. Notice that
n ® n / 2 ½¾ n n
¨k p = ¨ kp + ¨ kp v ¨ k p.
k =1 k =1 k =® n / 2 ½¾+1 k = ® n / 2 ½¾+1
Notice that in
n
¨ kp
k =® n /2 ½¾+1
Asymptotic Relationships 11
( )
p
there are n ® n / 2 ½¾ terms, where ® n / 2 ½¾ + 1 is the smallest term. Therefore,
we know that
n
n p+1
¨k p
v ( n / 2)( n / 2) p = .
k =1 2 p+1
( )
n
¨k p
= < n p+1 .
k =1
( )
n
¨k p
= 6 n p+1 .
k =1
Asymptotic Relationships
Useful relationships exist among 6, O, <, o, and \, some of which are given in
the following proposition. The reader might want to try to prove some of these.
(An instructor might want to assign some of these as homework problems.)
3. f ( n) = 6 ( g ( n) ) [ f ( n) = O ( g ( n) ) and f ( n) = < ( g ( n) )]
4. f ( n) = o ( g ( n) ) g ( n) = \ ( f ( n) )
( )
5. f ( n) = o g ( n) lim
nqh
f ( n)
g ( n)
=0
( )
6. f ( n) = \ g ( n) lim
nqh
f ( n)
g ( n)
=h
12 Chapter 1 Asymptotic Analysis
f ( n)
lim = L.
nqh g ( n)
The possible outcomes of this relationship, and their implications, follow:
L = 0: This means that g(n) grows at a faster rate than f (n), and hence
that f = O(g) (indeed, f = o(g) and f | 6 (g)).
L = h: This means that f (n) grows at a faster rate than g(n), and hence
that f = <(g) (indeed, f = \(g) and f | 6 (g)).
L | 0 is finite: This means that f (n) and g(n) grow at the same rate, to
within a constant factor, and hence that f = 6(g), or equivalently, g = 6( f ).
Notice that this also means that f = O(g), g = O( f ), f = <(g), and g = <( f ).
f ( n)
There is no limit: In the case where lim does not exist, this technique
nqh g ( n )
cannot be used to determine the asymptotic relationship between f(n) and
g(n).
We now give some examples of how to determine asymptotic relationships
based on taking limits of a quotient.
EXAMPLE
Let
n( n + 1)
f ( n) = and g(n) = n2.
2
Then we can show that f (n) = 6(g(n)) because
f ( n) n2 + n
lim = lim =
nqh g ( n) nqh 2 n2
EXAMPLE
If P(n) is a polynomial of degree d, then P(n) = 6(nd ). The proof is left to the
reader as an exercise.
EXAMPLE
d f (x)
e = e f ( x ) f '( x ).
dx
We have
n
2n eln 2 e n ln 2
lim 100 = lim 100 = lim 1000 .
nqh n nqh n nqh n
We can apply L’Hopital’s Rule to the numerator and denominator of this limit
100 times. After this, we have
( )
100
2n e n ln 2 ln 2 2 n
lim 100 = lim 100 = lim = h.
nqh n nqh n nqh 100!
Therefore, we know that n100 = O(2n) and 2n = <(n100). In addition, using some
of the properties previously presented, we know that n100 = o(2n) and
2n = \(n100). Further, we know that n100 | 6(2n).
EXAMPLE
which evaluates as
1
lim = lim n = h.
nqh 1 / n nqh
Therefore, ln n = O (n).
We remind the reader that log b x = (log b a)(log a x), for positive a, b, and x
with a | 1 | b . Therefore, because log b a is a constant, log b x = 6(log a x). That is,
the base of a logarithm is irrelevant inside asymptotic notation, except that we
assume a, b > 1 (so that the logarithms are positive, because we generally have
x > 1 in such contexts).
h(n) h(n)
h(1) h(1)
1 2 ... ... n 01 ... ... n−1
n
FIGURE 1.8 An illustration of bounding the summation ¨ h(i) by the integral of
i=1
the nondecreasing function h(t). On the left, we demonstrate how to use the inte-
n +1
gral µ1
h( t )dt to derive an upper bound on the summation by aligning the rec-
n n +1
tangles to the right. Notice that ¨ h(i) f µ 1
h(t)dt . On the right, we show how
i=1
n
to use the integral µ0
h(t)dt to derive a lower bound on the summation by align-
n
n
ing the rectangles to the left. Notice that µ h(t)dt f ¨ h(i) . Therefore, we have
0
n n n +1 i=1
and the rectangles bounding the area under the curve (right side). In addition, we
show how to combine these relationships to obtain a bound on the summation by
related integrals.
The method of determining asymptotic analysis of a summation by integration
is quite powerful. Next, we give several examples and, in doing so, illustrate a
variety of techniques and review some basic principles of integration.
EXAMPLE
First, we consider the integral bounding principles that were given previously.
Because the function h(i) = i is nondecreasing, we can apply the conclusion di-
rectly and arrive at the bound
n
n n+1
µ tdt f ¨ i f µ tdt.
0 1
i =1
( )
2
n2 n n +1 1
f ¨i f .
2 i=1 2 2
Working with the right side of this inequality, we can obtain
( n + 1)2 1 1 2
= n + n.
2 2 2
Further simplification of the right side can be used to give
1 2 1
n + n f n2 + n2
2 2
Asymptotic Relationships 17
for n v 1 . Therefore,
1 2 n 3
n f ¨ i f n2 .
2 i =1 2
is bounded by a multiple of n2 on both the left and right sides, we can conclude
that
( )
n
f ( n) = ¨ i = 6 n 2 .
i =1
EXAMPLE
1
First, it is important to realize that the function k is a nonincreasing function.
This requires an update in the analysis presented for nondecreasing functions.
In Figure 1.9, we present a figure that illustrates the behavior of a nonincreas-
ing function over the interval [ a, b] . Notice that with the proper analysis, you
should be able to show that
b b
b
¨ f ( k ) f µ f ( x ) dx f ¨ f ( k ).
a
k = a +1 k =a
Because
n 1 n
µ dx = ln x ¼¾ 1 = ln n ln 1 = ln n,
1 x
we know that g(n) is bounded below by ln n.
Next, we consider an upper bound on g(n). Notice that if we apply the re-
sult of our analysis for a nonincreasing function blindly, we obtain
n
1 n 1 n
¨k f µ dx = ln x ¼¾ 0 = h.
k =1
0 x
Unfortunately, this result does not yield a useful upper bound. However, notice
that the cause of this infinite upper bound is evaluation of the integral at the
specific point of 0. This problem can be alleviated by carefully rewriting the
equation to avoid the problematic point. Let’s consider the more restricted
inequality
n
1 n 1
¨k f µ 1 x
dx.
k =2
Notice that the integral evaluates to ln n. Therefore, if we now add back in the
problematic term, we arrive at
n n
1 1 n1
¨k = 1 + ¨ k f 1 + µ1 x dx = 1 + ln n.
k =1 k =2
Combining the results of both the upper and lower bounds on g(n), we arrive at
n
1
ln n f ¨ f 1 + ln n f 2 ln n,
k =1 k
¨ k = 6 ( ln n).
1
k =1
Asymptotic Relationships 19
a a1 b1 b
EXAMPLE
( )
n
f ( n) = ¨ k p = 6 n p+1 .
k =1
However, we now show how to obtain this result by another method.) Consider
the derivative of k p. For k > 0 , we have
d p
k = pk p1 > 0.
dk
Therefore, the function k p is an increasing function. A quick sketch of an in-
creasing function (f is increasing if u < v ¡ f (u ) < f ( v ) ), in a setting more
general than illustrated earlier, appears in Figure 1.10.
20 Chapter 1 Asymptotic Analysis
n n+1
x p+1 n
x p+1
f ¨k p f , or
p + 1 0 k =1 p +11
( ) ( )
p +1 p +1
n p+1 n n +1 1 n +1
f ¨k p f < .
p + 1 k =1 p +1 p +1
Because n + 1 f 2 n for n v 1 ,
( ) ( 2n)
p +1 p +1
n p+1 n n +1 2 p+1 n p+1
f ¨k p f f = , or
p + 1 k =1 p +1 p +1 p +1
which, based on asymptotic properties given earlier in this chapter, yields the
expected solution of
( )
n
¨k p
= 6 n p+1 .
k =1
a b
EXAMPLE (INSERTIONSORT)
Subprogram InsertionSort(X)
Input: an array X of n entries
Output: the array X with its entries in ascending order
Local Variables: indices current, insertPlace
Action:
For current = 2 to n do
{The first (current–1) entries of X are ordered.
This is why current is initially set to 2.}
Search X[1…current–1] to determine the index, denoted as insertPlace
{1,…,current –1}, where X[current] should be inserted.
Make a copy of X[current].
Shift the elements X[insertPlace,…, current–1] down by one position
into elements X[insertPlace+1,…,current].
Place the copy of X[current] into its proper position at
X[insertPlace].
End For
this requires 6(k) time on average. Alternately, an O(logk) time binary search
can be performed, as will be discussed in the chapter on Induction and Recur-
sion. Thus, the total search time is
( )
© n ¹
O ª ¨ k º = O n2
« k =2 »
time if sequential searches are used, and
© n ¹
(
O ª ¨ log k º = O n log n
« k =2 »
)
time if binary searches are used. Notice that O-notation is used, because both
results represent upper bounds on the search time.
Regardless of which search is used to locate the position that X[current]
should be moved to, notice that on average, it will require current/2 movements
of data items to make room for X [current]. In fact, in the worst case, the insert
step always requires X[current] to be moved to position number 1, requiring
current data items to be moved. Therefore, the running time of the algorithm is
dominated by the data movement, which is given by
n
T ( n) = ¨ movementk
k =2
where movementk is 0 in the best case, k in the worst case, and k/2 in the aver-
age case. Hence, the running time of InsertionSort is 6(n) in the best case
(when data is already sorted and a sequential search from (current – 1) down to
1 is used), 6(n2) in the average (or expected) case, and 6(n2) in the worst case.
The reader should verify these results by substituting the appropriate values
into the summation and simplifying the equation. Notice that the average- and
worst-case running times are dominated by the data movement operations.
Finally, notice that 6(n) space is required for the algorithm to store the n
data items. More important, the amount of extra space required for this algo-
rithm is constant, that is, 6(1). An insertion routine follows.
Action:
Subprogram InsertionSort(x, n)
{This is a simple version of InsertionSort with sequential search.}
For i = 2 to n, do
hold = x[i]
position = 1
While hold > x[position], do
position = position + 1
End While
If position < i, then
For j = i downto position, do
x[j] = x[j – 1]
End For
x[position] = hold
End If
End For
End InsertionSort
4 3 3 1 1
3 4 4 3 2
5 5 5 4 3
1 1 1 5 4
2 2 2 2 5
EXAMPLE: BINSORT
For example, suppose you know that you are required to sort data that is
chosen from a restricted set. Maybe you know that the keys can take on only
O(n) distinct values. In this case, one can employ a BinSort algorithm. BinSort
is modeled on the process of placing each member of a collection of numbered
items (such as machine parts) into a correspondingly numbered bin. Alterna-
tively, one might think about sorting a deck of cards by going through the deck
once, tossing all the aces in one pile, all the 2s in another, and so on. Once you
have gone through all the cards and created your 13 bins, you simply need to
concatenate the bins to create the final sorted set. Notice that if you sort more
than one deck of cards, you still need only 13 bins. Given one complete deck of
cards, each bin will wind up with exactly four cards in it. An example of Bin-
Sort is presented in Figure 1.12.
Next, we give a description of BinSort under the assumption that the range
of data is the integer values from 1 to n. It is important to note (in terms of the
proof that <(nlog n) comparisons are required to sort an arbitrary set of data by
a comparison-based sort) that BinSort is not a “comparison-based” sorting al-
gorithm. That is, BinSort does not rely on comparing data items to each other.
In fact, the algorithm never compares two data items.
Subprogram BinSort(X)
Sort the array X via the BinSort algorithm.
We assume entries of X have integer key values 1… n.
Local variables: indices j, s;
For j = 1 to n, do
{make temp[j] an empty stack}
temp[j] = null
For j = 1 to n, do
push(X[j], temp[X[j].key])
s=1
For j = 1 to n, do
while emptyStack(temp[s])
s o s +1
end while
pop(temp[s], X[j])
End For
An analysis of the algorithm follows. It is easy to see that the first two For
loops each require 6(n) time, after which each element is in one of the n bins.
Another Random Scribd Document
with Unrelated Content
towards him; but another voice told her she had no right, outcast as
she was, to marry this man; that such an act would make her guilty
forever of having destroyed him as a part of society. A sacrifice was
demanded of her! She must be more generous even than he,
subdue herself, suffer, submit to her fate, refrain from dragging him
down with her! She did not know where the voice came from. It may
have been crying out to her from that afternoon when she first
listened to Monsalvat telling her to suffer in order to find
redemption; but it was a voice that awed her tormented soul even
while it bade her speak and leave this man. Then the strange
serenity of sacrifice came to her rescue. She was pale as death, and
smiled so as not to weep. She summoned all the love within her not
to let her yield.
"Yes, you must marry me," Monsalvat was insisting desperately.
"No."
"What is it, Nacha? Why are you so strange? I love you, you love
me...."
Her will triumphed. She called to mind other moments of her life and
made one supreme effort. Then she began to laugh.
"No, I couldn't love you. All this is ridiculous anyway! Such make-
believe is unworthy of you. I put you out of my house once before,
and I'll do it again. You simply want to make fun of me, because I'm
a poor girl, and defenceless. You wanted to make a fool of me,
getting me to swallow all this stuff! But now it's my turn to laugh at
you, just as I did in the cabaret. I—married! And to you, a crazy
man!"
She broke into a laugh that was loud and false and harsh.
Monsalvat remained seated, his hands clasped over his head; he was
dizzy with pain, and he could not understand....
"You are mad ... you have gone mad!" he exclaimed.
Was she really fainting? She saw Monsalvat cover his face with his
hands; she turned to the wall and leaned against it, letting herself
weep for a brief moment. There was relief in that. With renewed
strength, she sat down on a chair and waited. Soon Monsalvat stood
up. He too was pale as he came near her and, barely looking at her,
held out his hand.
"Some time ... you will ... let me see you?" he faltered.
"No. Why should I? I don't love you. Leave me. And if it's true that
you love me, forget me as soon as you can. Go, please! I am ill, and
want to be alone...."
Monsalvat did not insist. He could not have done so. He took his hat
and went away, stumbling like a man who has come to the end of
his strength. One might have thought him sick, or crazy, or perhaps
drunk, as he staggered out. Crossing that threshold was like
wrenching his soul from his body; and in the little parlor that knew
only shabbiness and shame, grief remained, lending it a dignity it
had never known before.
Nacha could no longer hold her anguish at bay. She snatched off her
hat with a frantic gesture, and tore it into bits. Moaning and weeping
she fled into one of the other rooms and threw herself down on the
bed.
The cripple rolled her wheel chair to the door and looked in.
Believing that she understood Nacha's trouble, she did not disturb
her, but went away again. She talked to the girls awhile; but the
tragedy she saw close at hand saddened her; for it reminded her of
old intimate griefs of her own. She too, in her youth, had known
love, in far away Italy; and that love had been maimed and
destroyed. After that, dishonor and vice seemed a small matter; yet,
at times, even now, she went back in thought to the home of her
childhood, so different in its simple beauty from the wretchedness of
her present surroundings. But here she was, old, crippled, with no
choice but to go on in the familiar rut. Why let herself be saddened
then? She had known life, and found that melancholy had a bad
effect on the liver! So she chatted with the girls, merrily, as was her
custom whenever she felt a touch of sadness.
But someone came in, and asked for Nacha. The cripple rolled her
chair into the bedroom where the girl was still weeping, her head
almost hidden by the pillow.
"Nacha child! Don't cry that way! Why let yourself suffer so? No man
is worth it. You know that. You are worth more than the best of
them, you have a good heart ... and they...."
She muttered an obscene word to herself and began to laugh.
"Come, Nacha, someone wants to see you. They are all alike! No
one of them is worth more than another. They're all rotten—just
good to ruin women and then desert them. Come, child, come—
here's a friend!"
She patted Nacha on the shoulder, and told her she would send her
caller in. Nacha suddenly sat up. She wiped away her tears and said
quietly, "No, señora. Don't send him. I am going away for good."
"But, child, why? Are you angry with me?" the old cripple exclaimed,
astonished by Nacha's tone. "Aren't you ever coming back to my
house?"
"Neither to your house nor to any other. I am not angry. You have
been very kind to me, and I shall never forget it."
"Well then...." The woman did not know what to make of the girl's
words.
Nacha was silent while she smoothed her hair, and straightened her
dress. Then she kissed the cripple, took both her hands and said,
her lips quivering with pain:
"It's because ... I want to be worthy ... of that man's love...."
"Oh, I see. You want to be respectable for awhile, and then get
married...."
The cripple spoke with the certainty of a woman who understands
what she is talking about. Nacha's expression, however, indicated
that her purpose was not quite as the cripple supposed.
"What is it then? Tell me. You know I like you, child, and respect
you. And I'd do for you anything you ask. If you want to live decent,
and need money, I'll give it to you—I'll save so I can!"
Nacha was touched.
"You are good, señora. I thank you from my very heart; and because
I know how good you are, I'll tell you. No, I'm not going to get
married. I couldn't let him marry me. But he loves me—so much!
And if he gives me such great love, I want to be decent. Not to get
married, no, just to be worthy of living in his thoughts, and in his
heart...."
The paralytic drew the girl's head down to her twisted old lips and
kissed her. Freeing herself from the woman's embrace, Nacha hastily
left the room.
As she fled down the stairs she realized that it was many years since
she had felt as happy as at that moment!
CHAPTER XVI
One afternoon as Torres was lunching with Ruiz de Castro in a
restaurant on the Esmeralda he thought he caught a glimpse of
Nacha.
As a matter of fact it was Nacha. She was returning to the store
where she had been employed some six years earlier, and with her
were a number of other girl employees, for it was nearly two o'clock,
the end of the lunch hour. Torres would have gone up to speak to
her if he had been alone; but Ruiz was relating his adventures with
that plump lady who had carried on so persistent a discussion with
Monsalvat at de Castro's dinner party, and had so eloquently
defended established institutions.
"You don't say!" murmured Torres, absently; for all his attention was
fixed on the slender figure hovering in front of the huge shop door
which was about to open and swallow her up.
"She's a wonder, my friend," proclaimed Ruiz, who was given to
committing indiscretions in words as well as actions. "What passion!
and how she can sob!"
When Torres reached his house he went at once to talk to Monsalvat
who was now living with him. After the serious illness that had
followed close upon his interview with Nacha, Torres had taken him
in hand, and when he discovered that his patient was paying no
attention to doctor's orders, had carried him off to his own home
where he could insist on obedience. He persuaded Monsalvat to ask
for a two months' leave, for there was no doubt that he was
suffering from brain-fag and serious nervous derangement.
Torres had a theory that Monsalvat's condition was not entirely due
to his passion for Nacha. He knew the history of his friend's moral
struggles, and he believed that the causes of Monsalvat's illness
were numerous and complex. The latter's abrupt change of attitude
towards life could not but profoundly affect his whole nature.
Following this, had come several months of constant self-reproach,
and self-disgust for the uselessness and selfishness of his life up to
that time. He went as far as to blame himself for his inability to
transform the world. Torres had tried, vainly, to prove to him that he
was far from useless, and that no one could have called him selfish.
His conduct compared surprisingly well with that of other men of his
generation; and his reputation indicated general recognition of that
fact. Monsalvat protested that all this might be true from a
superficial and worldly view of his life, but it only proved how false
were society's standards.
"Useless and selfish," Monsalvat repeated. "Not less so than
prominent politicians or ranch owners, lawyers, and men in society.
We are all selfish. I do not condemn myself only. I condemn all the
rest as well. The world is full of evil, selfishness, meanness—and I
have shared in it all. That is why I despise myself, and abhor my
past life."
Torres wisely kept silent, for fear of exciting his patient.
It was clear also that the knowledge of his sister's mode of life, and
of the degradation his mother had fallen into before her death, had
seriously injured Monsalvat's nervous system. The scene with Irene,
his worrying about the tenement, the anxieties of that search
through the world of fallen women, the sight of so many horrors,
had all left their mark on him; and finally the shock of Eugenia's
death, intensified by the manner in which he had learned of it, had
played its part in undermining his health. Obviously his love for
Nacha, his unsuccessful attempt to save her, the knowledge that she
was leading a vicious life, perhaps because of him, were the
principal causes of his breakdown, but all these other matters played
an important part in bringing about his present condition.
Now, however, after two months of rest and quiet, Monsalvat was
beginning to be himself. The companionship of Torres had done him
a great deal of good. The doctor made him eat, gave him stimulants
when he needed them, encouraged him to spend most of his time
out of doors and even stayed up with him on the nights when he
was unable to sleep.
Torres might have accomplished a complete cure, had not the evil
that flourishes in certain human hearts prevented. Monsalvat had
recently received some anonymous letters, four in all. One of them
insulted him by insulting his mother, another called him to account
for living on women, and being an anarchist! The other two were
content with intimating that he belonged in a lunatic asylum, and
would soon be put there. The effect of these letters was to excite
him so that he could neither sleep nor eat. The first especially
reawakened in him his life-long obsession, cruelly reminding him of
what was, in his estimation, the reason for his moral bankruptcy.
The doctor wondered who could have sent these letters, for
Monsalvat's position was not such as to excite envy. At the Ministry
his new ideas had become known, and Monsalvat was looked upon
with hostility or contempt. Even the Minister mistrusted him now. In
the social circles where he was once respected, he had lost all
consideration. Ercasty was methodically discrediting him, with
admirable persistence and thoroughness. Informed by mutual
acquaintances of Monsalvat's views with respect to Nacha and other
girls of her sort, and of that frantic search through houses of ill-
fame, he confirmed the rumor that Monsalvat had fallen very low
indeed. At first he was content with making insinuations; but finally
he came out with the bald statement that Monsalvat was a vulgar
exploiter of women. Of course there were not lacking those who
accused him of participating in frightful anarchist plots, and
preparing bombs for wholesale assassinations.
Financially too he was ruined. The forty thousand of the mortgage
raised on his property had melted away. His mother's debts, the
mulatto's blackmail, Moreno's incessant appeals, had taken several
thousand. His excursion through the city's public houses had cost
him four thousand pesos. Ten thousand pesos had gone for
improvements on the tenement. Monsalvat decided he would have
to sell the building, for his salary was barely enough for his own
expenses, and his tenants either paid no rent or paid very little.
That afternoon Monsalvat was reading as he lay in bed. The book
beside him was the New Testament. On his face was reflected
something of the serenity of late afternoon. When Torres opened the
window to let in air and sunshine, everything in the room seemed to
draw a breath, and grow animate. A bar of light like a luminous
golden coverlet spread over the bed.
"Look at that!" exclaimed the doctor. "And you spend your time shut
up here almost in the dark. You'll never get well that way. You ought
to go to Palermo, stay out in the sun—and not read or write a line."
"I know what I need," replied his friend quietly.
"What do you need? You are always mysterious."
Monsalvat went on reading. Torres remained with him for a few
moments and then withdrew without a word.
The doctor had been observing his friend for over a month, with
constantly growing curiosity. Monsalvat's intelligence seemed to have
grown sharper and deeper. He was still weak in body but his mind
was keener than ever. He reasoned with irrefutable logic, and
divined his opponent's arguments at a word. Torres attributed this
mental fitness to mental exercise. His patient talked with no one but
his host, did not go out, read very little; but all day long he was
occupied in thinking and remembering, trying to interpret his past
life, trying to understand the significance of the life he was then
experiencing. He spent hours analyzing the persons he knew, and
with extraordinary penetration. Torres was more than once
overcome with amazement when Monsalvat guessed his thoughts.
"Why should you be startled?" Monsalvat asked him on a certain
occasion. "What has happened is simply this. I am living from within
now. Up to six months ago I lived from without, superficially; and
the life I lived seemed to be the life of other people rather than my
own. It was an objective, a false, a lying kind of life. Just like your
own and that of nearly everyone. A materialistic kind of life, never
transcending the commonplace, devoid of mystery, and of genuinely
spiritual anxiety. But now my eyes are open and I begin to
understand. I have analyzed myself, I have looked within; and I
have discovered a great many things there that I knew nothing of. I
know now what there is in me, and what parts of it are worth
something, and what I must give to others. And I even begin to
suspect why I am alive!"
"I knew before that...."
Torres stopped abruptly, not caring to end his sentence. He
pretended to have forgotten what he wanted to say.
"Why don't you go on? Have you really forgotten what was on the
tip of your tongue? Well, I know what it was. You were going to say
that all that happened this past year, and the love I found, would
lead me straight to ... mysticism!"
"What? No, no, not that, exactly."
But that was exactly what he had been thinking. Monsalvat knew
how abhorrent to a man as orderly and normal, as submissive to
society's dicta, as Torres, the word "mysticism" must be. The doctor
had come to admit society's responsibility for much of the
unhappiness in the world; but he had no sympathy for those heroic
acts necessary to drive out injustice. He admired Monsalvat but at
the same time considered his passion for redeeming others a form of
insanity. According to Torres a normal man should accept things as
they are. The rebel, he who at sight of the suffering of life's victims,
breaks out into indignant accusations or takes up some useless but
heroic work, was, in his estimation, a madman.
Since his recent glimpse of Nacha, Torres had been anxious to talk
to her. Once or twice he watched the girls coming out of the shop.
He saw Nacha again, but it was very evident that she avoided him.
Convinced that Nacha did not care to hear any news of Monsalvat,
whose friendship with him she must have known, he gave up his
attempt to communicate with her.
The days went by. Monsalvat never spoke of Nacha and little by little
Torres came to the conclusion that he had forgotten her.
One morning, in March, Torres went to his guest's room at a very
early hour, to dissuade him from going away.
"Why leave me, Monsalvat? Stay here a couple of months longer,
until you are quite all right again. The kind of breakdown you're just
getting over is no joke, my dear boy. And where are you going
without a cent to your name, eh? Back to your quixotic notions
about righting all humanity's wrongs, and redeeming people who
have nothing to redeem about them? That's all nonsense, and leads
nowhere. One man alone can't accomplish anything. All you can do
is harm, filling the heads of those poor people with wild ideas. No,
my son. The world is full of evil. Well, what's to be done? You have
to take it as it is, and get what good you can out of it, and
—'forward, march!' Eh?"
Monsalvat did not reply. He lay on his side, his elbow resting on the
pillow, his hand on his breast, and his eyes turned towards the
window. But he was not looking at what was out there beyond him:
he was looking within, searching his own heart and the hearts of a
multitude of other human beings whom he saw there standing
between him and his friend. The doctor's words reached him from
far, far away—so far that he scarcely understood them. Meanwhile
the window seemed to be catching fire, making its offering of light
to Monsalvat as from a golden, quivering sheet of flame!
The doorbell rang. Without moving, Monsalvat said:
"That's the postman. He is bringing a letter from Nacha—for you."
Torres smiled at this prophecy; a forced smile, however, for he
feared that it might be true. He got up and was about to leave the
room when the maid came in with a letter. The doctor signed the
receipt for which the messenger was waiting, placing it for that
purpose on the table near Monsalvat's bed. He did not notice that
Monsalvat's eyes were fixed intently on the small bit of paper. Then
he opened the letter and looked at its signature, disconcerted.
Monsalvat laughed, enjoying his friend's confusion.
"It's from Ruiz de Castro. He wants to see me ... some affair of his
... he doesn't say what ..." stammered Torres, thrusting the letter
into his pocket. Then he went out, embarrassed and perplexed,
while Monsalvat smiled to himself.
For the letter actually did come from Nacha! She wrote that she
wanted to see Torres, but not at the entrance to the shop. From her
letter it appeared that she did not know where Monsalvat was. She
wanted to find out—that was why she wrote about him. She had
learned that he was ill; "Was it true?" she asked; and "was she to
blame?"
That evening Torres went to the lodgings at the address Nacha had
sent him. He found a respectable house, the tenants of which
appeared to be shop employees and their families.
"You don't know what I've been through," murmured Nacha. "We
met one afternoon, and I—"
Torres knew something of this meeting.
"But you don't know why I acted as I did," Nacha continued. "It was
because I loved him; because I didn't want to do him harm. So that
he, distinguished and fine as he is, shouldn't be ruined by
associating his life with that of a ... someone like myself.... You see?
Since that day I have lived straight; and somehow, I'm still alive,
although really I am dying ... with grief.... But this I accept, for his
sake, and to make up for the kind of life I led before. I accept it so
that he may not have to suffer, so that he will forget me, and be
happy, and go on with the kind of life he ought to have—even
though I die of it. What good am I?"
They were alone, facing each other over a small table, lit by a small
lamp which had been pushed to one side. Torres felt the shadows of
the room pressing around his throat, choking him. Nacha's face
alone stood out, catching the light. The doctor was thinking of the
frightful pranks Destiny can play.
But this emotion passed, and the man of the world, laden with
prejudices, falsehood, cruelties—and good, withal, replaced the plain
and honest man of feeling.
"You couldn't know what I've been through," Nacha repeated. "Since
that afternoon I have earned my living by work. First there were
days of discouragement, when I went hungry. Then I found
employment in a shop. Eleven hours a day and thirty dollars a
month! I get a bonus too. But there are fines for the slightest thing.
Altogether I earn about sixty dollars more or less—there's no rest
during those eleven hours. Sometimes they send me with a load of
goods up to the fifth floor. We aren't allowed to use the elevators. It
isn't a gay life, you see. But it's for him, so I don't mind! Not so that
he'll love me—I'm not worthy of living with him—just to deserve,
even at a distance, a little of the love he has for me!"
Torres looked away from her; it occurred to him that this change in
Nacha was a danger for Monsalvat. He believed he must save his
friend once for all, and to accomplish that required a lie. He reflected
that it was really too bad that deceit should at times be necessary,
even to accomplish good results. Something inquired of him if he
really believed that the purpose he had in view was "good." He
hesitated a moment; but he remembered the world's opinion, the
world's morality, the world's sentiments. He turned towards Nacha,
and with a gesture as if he was casting from him an unpleasant
thought, and in a hard voice, he said:
"You must not see him again, Nacha, ever. Anyway, he has forgotten
you. Yes! He is in love with another woman, and is thinking of
getting married. You don't want to wreck his plans, eh?"
She could not see. Everything was dark. She felt a "yes" come
mechanically from her throat, and she put out a hand, so inert, that
it barely felt the rapid pressure of another hand. Then came the
noise of a closing door, and the sound of retreating footsteps. But
darkness remained, empty ... and endless.
As she sat at the small table, her senses dull to everything, she did
not hear a knock at her door; nor was she aware that a man had
come in and was there, before her, waiting. A sudden leap of her
heart, and a flash of consciousness made her raise her eyes. She
thought she must be feverish, in a delirium! She would have cried
out, but something within her, that overpowered her, muffled her
voice.
"Nacha!" he said.
"Is this true? It is not a dream? Not a dream?"
They were face to face, but they could not speak. No words could
express what shone in Monsalvat's eyes, and echoed in Nacha's
breathless weeping. The room seemed to fill with memories of the
distant past, scenes fraught with sorrow, and ancient longings,
taking on a strange, mysterious life, like an old temple that has
heard the prayers of centuries.
Nacha's tears were for what had been, and what ought to have
been; for what she had not wanted to be, and what the world had
forced her to become. Monsalvat sat at her side, caressing her
hands; but he saw facing him the two men he had been in his
lifetime, and he demanded an account of them for what his life had
been, looking into their very souls, cursing them; and before Nacha
passed the different women who had dwelt in her body, the bad
woman, and the good, the victim and the weakling.
And in that dim light, they understood one another, these two
suffering human beings. The light in the heart of each shone out to
the other. Their heads drew close together. Without knowing it,
without seeking it, they kissed gently, like children of one mother.
CHAPTER XVII
Monsalvat that very afternoon had taken lodgings in the house in
order to be near Nacha. As Torres signed it, he read the receipt of
the special delivery letter; and he hurried to the Messenger Service
Bureau and there learned Nacha's address. When he reached the
building where she lived he noticed a sign announcing a furnished
room to let in this tenement which was an old family dwelling, now
rented out to numerous lodgers. Monsalvat took the room on the top
floor facing the street. Thus, it happened that when he appeared in
Nacha's quarters he was already a tenant in the same house.
Torres' efforts to find out what had become of Monsalvat were all
unsuccessful. He even wrote to Nacha, who replied that she had not
seen him nor had any news of him. These falsehoods did not much
trouble her conscience. She wanted to keep Monsalvat near her,
have him for herself alone; and she was fearful of his friends, of his
associates at the ministry, of everything which threatened to
interrupt her possession of him. When, in the afternoon, she came
home from work, she could scarcely breathe with the anxiety and
the fear of no longer finding him there.
But the emotion she felt was to all appearances purely fraternal.
Suffering had spiritualized it. The first kiss had been the last. Nacha
knew how little the physical aspect of love meant. She could not
offer her lover something of as little price as her body. To Monsalvat
she would give her heart and soul and whatever good there was in
her; her tenderness, as immeasurable as space, and her suffering,
as deep as the sea. Nor did he desire her. Nacha was no longer a
mere woman to him; she had become a symbol, tremendously
significant, of all women who pay the penalty she was paying, of
those victims rejected by society—daughters of the mire and of
human misery; and she was his sister as well. If at times he desired
Nacha, the desire was fleeting, a passing sentiment. He knew that it
was this sentiment which had drawn him towards her; and in this
fact he saw a proof of the wisdom of instinct, of nature's
fundamental soundness; for desire had, in moments of vacillation
and uneasiness of conscience, led him to the right road. Now he was
no longer a man of the world, nor a distinguished lawyer, nor
anything else that he had been. As far as the world was concerned,
he was a ruined man. But in his own eyes he had saved himself,
found a purpose for his life; the purpose to give everything he had
to others, and to suffer for them. What did all the rest matter if, in
this course of conduct, he found what he recognized as the "Good"
he craved?
And so time passed. Nacha went to the shop in the morning, and
returned at night. Monsalvat went out only to go to the Ministry, and
to offer relief to those in great need. When he came back from the
office he gathered the children in the house together and taught
them to read; and his evenings were for Nacha, for long waking
dreams—a book in his hands, and silence keeping watch over them
like a faithful dog. His evenings were for that idealized love which
Nacha too now understood.
But one evening Nacha told him of the doubts that troubled her.
Why sacrifice one's life, and tranquillity, and happiness, for others?
With so much wretchedness in the world, what could one man's slow
and small accomplishment matter? And why give one's whole soul to
something that offered no visible reward?
"Nacha," he replied, "to sacrifice ourselves for others is a duty. It is
the only reason for our living. If we all accepted this principle, life
would be inconceivably beautiful. And what other principle makes
our lives consistent with our opinions and our ideals—granted we
have opinions and ideals? It is an obligation we owe to those from
whom we have taken their share of happiness. There are not many
who pay this debt, not many who comply with this law. People not
only resist the law of love implicit in sacrifice, but they will to be
selfish, and bad. But doesn't that make it all the more our duty,
Nacha, to do what we can? We must win forgiveness for the wrongs
we do our brothers, for the guilt of society in which we all share."
He stopped, and looked dreamily before him, as though he saw
some luminous object in the distance. Then, after a moment of
silence, he added:
"The work of one individual has tremendous value as an example.
Good work is not lost. It arouses other souls; and each one of these
will waken others, who, but for them, would continue to sleep. So,
little by little, daylight will come; injustice will cease; and poverty will
be a word."
Monsalvat was at work on two plays which Nacha helped him to
copy. They proved to be somewhat incoherent compositions, full of
anguish, and love, and pity. They excited keen interest among the
theatrical managers to whom he submitted them but no one cared
to produce them. Some one of the readers who examined them
called the plays "anti-social"; and they were generally considered
dangerous to established order. In truth, they contained too much
human sympathy: but it may well be that justice, or even simple
honesty, is a serious menace to society!
One Sunday afternoon Julieta came to call on Nacha. She was no
longer the smiling Julieta of old. Bad luck had been haunting her
footsteps of late; and for the last few weeks she had known what it
was to go hungry. While she was telling Nacha her troubles
Monsalvat came in. Julieta did not know him, and stopped short.
"It is my friend," said Nacha. "He can help you. Go on!"
Julieta, reassured as much by a glance at Monsalvat as by Nacha's
words, told how her small savings had all been spent to help Sara
who had suddenly developed a horrible disease.
"I thought I could earn more if I had to," said Julieta, "but I haven't
been able to. I've had to give up my room at Lavalle Street; and
they are going to put me out of the lodging house where I have
been staying, because my rent isn't paid. I can't go out on the
street! But I'm discouraged. What can I do? I had hoped to get away
from this life somehow; and now it seems as though I would have to
go deeper into it than ever before—and after seeing what has
happened to poor Sara! Oh, I can't bear to think of it!"
"Everything is going to come out right for you," Monsalvat said to
her gently. "What little I have is yours. Don't thank me. No, I shall
be angry if you do. It isn't mine after all. No one is the owner of
money. It's stupid to think so! Don't lose heart. I'm going to take
care of all your troubles. No, it isn't only for you I am doing this. It's
for myself, you see."
Monsalvat had received his salary that afternoon. He had just paid
his rent; and he gave all that remained to Julieta, who let herself be
persuaded finally to accept it. Then he left the girls alone.
As he went out of the door, he found, leaning against the wall
opposite, his legs crossed, an ill-favored individual who looked at
him with an impudent and sinister smile. Nacha could not endure
this cross-eyed and thoroughly unprepossessing loafer, who, it was
rumored, was a police spy. His small, close-set eyes, low forehead,
crushed-in nose and vicious expression all suggested the jail bird;
and Nacha could never see him without having a ghastly vision of all
the crimes a man is capable of; nor was she alone in fearing him.
But she learned on a certain occasion that he knew her past life, and
the discovery kept her awake many nights. As the days passed
without her hearing anything more from him, she put aside the
worst of her fears. The man watched Monsalvat closely and even
followed him on the street.
When Monsalvat returned to Nacha's room, Julieta had gone. Nacha
was depressed and this he naturally attributed to Julieta's trouble.
But Nacha was tormented by various concerns of her own, of which
she never spoke. One was her wretched poverty. To eke out her
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.
ebookultra.com