Data Structures Using C 2nd Edition A. K. Sharma download
Data Structures Using C 2nd Edition A. K. Sharma download
Sharma
pdf download
https://ebookname.com/product/data-structures-using-c-2nd-
edition-a-k-sharma/
https://ebookname.com/product/data-structures-with-c-using-
stl-2nd-edition-william-h-ford/
https://ebookname.com/product/c-data-structures-a-laboratory-
course-stefan-brandle/
https://ebookname.com/product/object-oriented-data-structures-
using-java-chip-weems/
https://ebookname.com/product/the-cyberspace-handbook-media-
practice-1st-edition-jason-whittaker/
https://ebookname.com/product/10-less-democracy-why-you-should-
trust-elites-a-little-more-and-the-masses-a-little-less-garett-
jones/
https://ebookname.com/product/modular-electricity-storage-
benefits-and-costs-1st-edition-brent-n-mendell/
https://ebookname.com/product/long-term-durability-of-structural-
materials-1st-edition-j-larsen-basse/
https://ebookname.com/product/international-law-and-post-
conflict-reconstruction-policy-1st-edition-matthew-saul-editor/
My Word Plagiarism and College Culture 1st Edition
Susan D. Blum
https://ebookname.com/product/my-word-plagiarism-and-college-
culture-1st-edition-susan-d-blum/
Data Structures Using C
This page is intentionally left blank.
Data Structures Using C
Second Edition
A. K. Sharma
Professor and Dean
YMCA University of Science and Technology
Delhi • Chennai
Copyright © 2013 Dorling Kindersley (India) Pvt. Ltd.
Licensees of Pearson Education in South Asia
No part of this eBook may be used or reproduced in any manner whatsoever without the publisher’s
prior written consent.
This eBook may or may not include all assets that were part of the print version. The publisher
reserves the right to remove any material in this eBook at any time.
ISBN 9788131792544
eISBN 9789332514225
Head Office: A-8(A), Sector 62, Knowledge Boulevard, 7th Floor, NOIDA 201 309, India
Registered Office: 11 Local Shopping Centre, Panchsheel Park, New Delhi 110 017, India
To
my parents,
wife Suman and daughter Sagun
This page is intentionally left blank.
Contents
Preface to the Second Edition xiii
Preface xiv
About the Author xv
Chapter 1: Overview of C 1
1.1 The History 1
1.2 Characters Used in C 2
1.3 Data Types 2
1.3.1 Integer Data Type (int) 2
1.3.2 Character Data Type (char) 3
1.3.3 The Floating Point (f loat) Data Type 3
1.4 C Tokens 4
1.4.1 Identifiers 4
1.4.2 Keywords 5
1.4.3 Variables 5
1.4.4 Constants 7
1.5 Structure of a C Program 8
1.5.1 Our First Program 8
1.6 printf() and scanf() Functions 8
1.6.1 How to Display Data Using printf() Function 9
1.6.2 How to Read Data from Keyboard Using scanf() 10
1.7 Comments 10
1.8 Escape Sequence (Backslash Character Constants) 11
1.9 Operators and Expressions 13
1.9.1 Arithmetic Operators 13
1.9.2 Relational and Logical Operators 14
1.9.3 Conditional Operator 16
1.9.4 Order of Evaluation of Expressions 17
1.9.5 Some Special Operators 18
1.9.6 Assignment Operator 18
1.9.7 Bitwise Shift Operators 19
1.10 Flow of Control 20
1.10.1 The Compound Statement 21
1.10.2 Selective Execution (Conditional Statements) 21
1.10.3 Repetitive Execution (Iterative Statements) 25
1.10.4 The exit() Function 27
1.10.5 Nested Loops 28
1.10.6 The Goto Statement (Unconditional Branching) 28
viii Data Structures Using C
Index 501
Preface to the
Second Edition
I have been encouraged by the excellent response given by the readers to the first edition of the book to
work on the second edition. As per the feedback received from the teachers of the subject and the input
provided by the team at Pearson Education, the following topics in various chapters of the book have
been added:
1. Sparse matrices
2. Recursion
3. Hashing
4. Weighted binary trees
a. Huffman algorithm
5. Spanning trees, minimum cost spanning trees
a. Kruskal algorithm
b. Prims algorithm
6. Shortest path problems
a. Warshall’s algorithm
b. Floyd’s algorithm
c. Dijkstra’s algorithm
7. Indexed file organization
While revising the book, the text has been thoroughly edited and the errors found thereof have been
corrected. More examples on important topics have been included.
I hope the readers will like this revised edition of the book and, as before, will provide their much
needed feedback and comments for further improvement.
Acknowledgements
I am thankful to Khushboo Jain and Anuradha Pillai for helping me in preparing the solution manual
of the book.
A. K. Sharma
Preface
As a student, programmer, and teacher of computer engineering, I find ‘Data Structures’ a core course of
computer engineering and particularly central to programming process.
In fact in our day-to-day life, we are confronted with situations such as where I would keep a bunch
of keys, a pen, coins, two thousand rupees, a chalk, and five hundred thousand rupees.
I would keep the bunch of keys and coins in the left and right pockets of my pants, respectively. The
pen gets clipped to the front pocket of the shirt whereas two thousand rupees would go into my ticket
pocket. I would definitely put the five hundred thousand rupees into a safe, i.e., under the lock and key.
While teaching, I will keep the chalk in hand. The decision of choosing the places for these items is based
on two factors: ease of accessibility and security.
Similarly, given a problem situation, a mature programmer chooses the most appropriate data
structures to organize and store data associated with the problem. The reason being that the intel-
ligent choice of data structures will decide the fate of the software in terms of effectiveness, speed
and efficiency—the three most important much-needed features for the success of a commercial
venture.
I have taught ‘Data Structures’ for more than a decade and, therefore, the demand to write a book on
this subject was there for quite some time by my students and teacher colleagues.
The hallmark of this book is that it would not only help students to understand the concepts govern-
ing the data structures but also to develop a talent in them to use the art of discrimination to choose the
right data structures for a given problem situation. In order to provide a hands-on experience to budding
software engineers, implementations of the operations defined on data structures using ‘C’ have been
provided. The book has a balance between the fundamentals and advanced features, supported by solved
examples.
This book would not have been possible without the well wishes and contribution of many people
in terms of suggestions and useful remarks provided by them during its production. I record my
thanks to Dr Ashutosh Dixit, Anuradha Pillai, Sandya Dixit, Dr Komal Bhatia, Rosy Bhatia, Harsh, and
Indu Grover.
I am indebted to my teachers and research guides, Professor J. P. Gupta, Professor Padam Kumar,
Professor Moinuddin, and Professor D. P. Agarwal, for their encouragement. I am also thankful to
my friends, Professor Asok De, Professor Qasim Rafiq, Professor N.S. Gill, Rajiv Kapur and Professor
Rajender Sahu, for their continuous support and useful comments.
I am also thankful to various teams at Pearson who made this beautiful book happen.
Finally, I would like to extend special thanks to my parents, wife Suman and daughter Sagun for
saying ‘yes’ for this project when both wanted to say ‘no’. I know that I have stolen some of the quality
time which I ought to have spent with them.
Some errors might have unwittingly crept in. I shall be grateful if they are brought to my notice.
I would also be happy to acknowledge suggestions for further improvement of this book.
A. K. Sharma
About the Author
A. K. Sharma is currently Chairman, Department of Computer Engineering, and
Dean of Faculty, Engineering and Technology at YMCA University of Science and
Technology, Faridabad. He is also a member of the Board of Studies committee of
Maharshi Dayanand University, Rohtak. He has guided ten Ph.D. theses and has
published about 215 research papers in national and international journals of re-
pute. He heads a group of researchers actively working on the design of different
types of ‘Crawlers.
This page is intentionally left blank.
Overview of C
1
Chapter
n Loose typing
n Structured language
n Wide use of pointers to access data structures and physical memory of the system
Besides the above characteristics, the C programs are small and efficient. A ‘C’ program can be
compiled on variety of computers.
2 Data Structures Using C
n Long integer: A long integer is referred to as long int or simple long. It is stored in 32 bits and
The unsigned int is stored in one word of the memory whereas the unsigned short is stored in
16 bits and does not depend upon the word size of the memory.
Examples of invalid integers are:
(i) 9, 24, 173 illegal-comma used
(ii) 5.29 illegal-decimal point used
(iii) 79 248 blank used
Overview of C 3
n double: The numbers of double data type are stored in 64 bits of memory.
4 Data Structures Using C
A summary of C basic data types is given the Table 1.1. From this table, it may be observed that charac-
ter and integer type data can also be declared as unsigned. Such data types are called unsigned data types.
In this representation, the data is always a positive number with range starting from 0 to a maximum
value. Thus, a number twice as big as a signed number can be represented through unsigned data types.
1.4 C TOKEnS
A token is a group of characters that logically belong together. In fact, a programmer can write a program
by using tokens. C supports the following types of tokens:
n Identifiers
n Keywords
n Constants
n Variables
1.4.1 Identifiers
Symbolic names can be used in C for various data items. For example, if a programmer desires to store a
value 27, then he can choose any symbolic name (say, ROLL) and use it as given below:
ROLL = 27;
Where ROLL is a memory location and the symbol ‘5’ is an assignment operator.
The significance of the above statement is that ‘ROLL’ is a symbolic name for a memory location
where the value 27 is being stored. A symbolic name is generally known as an identifier.
The identifier is a sequence of characters taken from C character set. The number of characters in
an identifier is not fixed though most of the C compilers allow 31 characters. The rules for the formation
of an identifier are:
n An identifier can consist of alphabets, digits and and/or underscores.
n C is case sensitive, i.e., upper case and lower case letters are considered different from each other.
n An identifier can start with an underscore character. Some special C names begin with the
underscore.
n Special characters such as blank space, comma, semicolon, colon, period, slash, etc. are not allowed.
n The name of an identifier should be so chosen that its usage and meaning becomes clear. For
example, total, salary, roll no, etc. are self explanatory identifiers.
Overview of C 5
1.4.2 Keywords
A keyword is a reserved word of C. This cannot be used n Table 1.2 Standard keywords in C
as an identifier by the user in his program. The set of C
auto double int struct
keywords is given in Table 1.2.
break else long switch
1.4.3 Variables case enum register typedef
A variable is the most fundamental aspect of any com- char extern return union
puter language. It is a location in the computer memory const float short unsigned
which can store data and is given a symbolic name for continue for signed void
easy reference. The variables can be used to hold differ-
default goto sizeof volatile
ent values at different times during a program run. To
do if static while
understand this concept, let us have a look at the follow-
ing set of statements:
Total 5 500.25; ...(i)
Net 5 Total 2 100.00; ...(ii)
In statement (i), value 500.25 has been stored in a memory location called Total. The variable Total
is being used in statement (ii) for the calculation of another variable Net. The point worth noting is that
‘the variable Total is used in statement (ii) by its name not by its value’.
Before a variable is used in a program, it has to be defined. This activity enables the compiler to
make available the appropriate amount of space and location in the memory. The definition of a variable
consists of its type followed by the name of the variable. For example, a variable called Total of type float
can be declared as shown below:
float Total;
Similarly, the variable net of type int can also be defined as shown below:
int Net;
Examples of valid variable declarations are:
(i) int count;
(ii) int i, j, k;
(iii) char ch, first;
6 Data Structures Using C
From Figure 1.3, we can see that besides its type a variable has three entities associated with it, i.e.,
the name of variable (val), its physical address (4715), and its contents (100). The content of a variable
is also called its rvalue whereas the physical address of the variable is called its lvalue. Thus, lvalue
and rvalue of variable val are 4715 and 100, respectively. The lvalue is of more importance because it
is an expression that should appear on the left hand side of assignment operator because it refers to the
variable or object.
Memory
1.4.4 Constants
A constant is a memory location which can store data in such a manner that its value during execu-
tion of a program does not change. Any attempt to change the value of a constant will result in an
error message. A constant in C can be of any of the basic data types, i.e., integer constant, float-
ing point constant, and character constant. const qualifier is used to declare a constant as shown
below:
const <type> <name> 5 <val>;
where
const: is a reserved word of C
<type>: is any of the basic data types
<name>: is the identifier name
<val>: is the value to be assigned to the constant.
(1) Integer constant: It is a constant which can be assigned integer values only. For example, if we
desire to have a constant called rate of type integer containing a fixed value 50, then the follow-
ing declaration can be used:
const int rate 5 50;
The above declaration means that rate is a constant of type integer having a fixed value 50. Consider
the following declaration:
const int rate;
rate 5 50;
The above initialization of constant rate is illegal. This is because of the reason that a constant can-
not be initialized for a value at a place other than where it is declared. It may be further noted that if a
program does not change or mutates\a constant or constant object then the program is called as const
correct.
(2) Floating point constant: It is a constant which can be assigned values of real or floating point
type. For example, if it is desired to have a constant called Pi containing value 3.1415, then the
following declaration can be used.
const float Pi = 3.1415;
The above declaration means that Pi is a constant of type float having a fixed value 3.1415. It may be
noted here that by default a floating point constant is of type double.
(3) Character constant: A character constant can contain a single character of information. Thus,
data such as ‘Y’ or ‘N’ is known as a character constant. Let us assume that it is desired to have a
constant called Akshar containing the character ‘Q’; following declaration can be used to obtain
such a constant.
const char Akshar = ‘Q’;
The above declaration means that Akshar is a constant of type char having a fixed value ‘Q’.
A sequence of characters enclosed within quotes is known as a string literal. For example, the
character sequence “computer” is a string literal. When a string literal is assigned to an identifier
declared as a constant, then it is known as a string constant. In fact, a string is an array of
characters. Arrays are discussed later in the chapter.
8 Data Structures Using C
Note:
(i) C is a case sensitive language, i.e., it distinguishes between upper case and lower case characters.
Thus, main() is different from Main(). In fact, most of the characters used in C are lowercase.
Hence, it is safest to type everything in lower case except when a programmer needs to capitalize
some text.
(ii) Every C program has a function called main followed by parentheses. It is from here that
program execution begins. A function is basically a subprogram and is complete in itself.
(iii) The task to be performed by a function is enclosed in curly braces called its body, i.e., {}.
These braces are equivalent to begin and end keywords used in some other languages like
Pascal. The body of function contains a set of statements and each statement must end with
a semicolon.
It was in the year 1801, whilst yet at school, that I made my first
literary acquaintance. This was with a gentleman now dead, and
little, at any time, known in the literary world; indeed, not at all; for
his authorship was confined to a department of religious literature as
obscure and as narrow in its influence as any that can be named—
viz. Swedenborgianism.
Already, on the bare mention of that word, a presumption arises
against any man, that, writing much (or writing at all) for a body of
doctrines so apparently crazy as those of Mr. Swedenborg, a man
must have bid adieu to all good sense and manliness of mind.
Indeed, this is so much of a settled case, that even to have written
against Mr. Swedenborg would be generally viewed as a suspicious
act, requiring explanation, and not very easily admitting of it. Mr.
Swedenborg I call him, because I understand that his title to call
himself "Baron" is imaginary; or rather he never did call himself by
any title of honour—that mistake having originated amongst his
followers in this country, who have chosen to designate him as the
"Honourable" and as the "Baron" Swedenborg, by way of translating,
to the ear of England, some one or other of those irrepresentable
distinctions, Legations-Rath, Hofrath, &c., which are tossed about
with so much profusion in the courts of continental Europe, on both
sides the Baltic. For myself, I cannot think myself qualified to speak
of any man's writings without a regular examination of some one or
two among those which his admirers regard as his best
performances. Yet, as any happened to fall in my way, I have looked
into them; and the impression left upon my mind was certainly not
favourable to their author. They laboured, to my feeling, with two
opposite qualities of annoyance, but which I believe not
uncommonly found united in lunatics—excessive dulness or matter-
of-factness in the execution, with excessive extravagance in the
conceptions. The result, at least, was most unhappy: for, of all
writers, Swedenborg is the only one I ever heard of who has
contrived to strip even the shadowy world beyond the grave of all its
mystery and all its awe. From the very heaven of heavens, he has
rent away the veil; no need for seraphs to "tremble while they
gaze"; for the familiarity with which all objects are invested makes it
impossible that even poor mortals should find any reason to tremble.
Until I saw this book, I had not conceived it possible to carry an
atmosphere so earthy, and steaming with the vapours of earth, into
regions which, by early connexion in our infant thoughts with the
sanctities of death, have a hold upon the reverential affections such
as they rarely lose. In this view, I should conceive that Swedenborg,
if it were at all possible for him to become a popular author, would,
at the same time, become immensely mischievous. He would
dereligionize men beyond all other authors whatsoever.
Little could this character of Swedenborg's writings—this, indeed,
least of all—have been suspected from the temper, mind, or
manners of my new friend. He was the most spiritual-looking, the
most saintly in outward aspect, of all human beings whom I have
known throughout life. He was rather tall, pale, and thin; the most
unfleshly, the most of a sublimated spirit dwelling already more than
half in some purer world, that a poet could have imagined. He was
already aged when I first knew him, a clergyman of the Church of
England; which may seem strange in connexion with his
Swedenborgianism; but he was, however, so. He was rector of a
large parish in a large town, the more active duties of which parish
were discharged by his curate; but much of the duties within the
church were still discharged by himself, and with such exemplary
zeal that his parishioners, afterwards celebrating the fiftieth
anniversary, or golden jubilee of his appointment to the living (the
twenty-fifth anniversary is called in German the silver—the fiftieth,
the golden jubilee), went farther than is usual in giving a public
expression and a permanent shape to their sentiments of love and
veneration. I am surprised, on reflection, that this venerable
clergyman should have been unvexed by Episcopal censures. He
might, and I dare say would, keep back the grosser parts of
Swedenborg's views from a public display; but, in one point, it would
not be easy for a man so conscientious to make a compromise
between his ecclesiastical duty and his private belief; for I have since
found, though I did not then know it, that Swedenborg held a very
peculiar creed on the article of atonement. From the slight pamphlet
which let me into this secret I could not accurately collect the exact
distinctions of his creed; but it was very different from that of the
English Church.
However, my friend continued unvexed for a good deal more than
fifty years, enjoying that peace, external as well as internal, which,
by so eminent a title, belonged to a spirit so evangelically meek and
dovelike. I mention him chiefly for the sake of describing his
interesting house and household, so different from all which belong
to this troubled age, and his impressive style of living. The house
seemed almost monastic; and yet it stood in the centre of one of the
largest, busiest, noisiest towns in England; and the whole household
seemed to have stepped out of their places in some Vandyke, or
even some Titian, picture, from a forgotten century and another
climate. On knocking at the door, which of itself seemed an outrage
to the spirit of quietness which brooded over the place, you were
received by an ancient manservant in the sober livery which
belonged traditionally to Mr.—— 's[22] family; for he was of a
gentleman's descent, and had had the most finished education of a
gentleman. This venerable old butler put me in mind always, by his
noiseless steps, of the Castle of Indolence, where the porter or
usher walked about in shoes that were shod with felt, lest any rude
echoes might be roused. An ancient housekeeper was equally
venerable, equally gentle in her deportment, quiet in her
movements, and inaudible in her tread. One or other of these upper
domestics,—for the others rarely crossed my path,—ushered me
always into some room expressing by its furniture, its pictures, and
its coloured windows, the solemn tranquillity which, for half a
century, had reigned in that mansion. Among the pictures were more
than one of St. John, the beloved apostle, by Italian masters.
Neither the features nor the expression were very wide of Mr.
Clowes's own countenance; and, had it been possible to forget the
gross character of Swedenborg's reveries, or to substitute for these
fleshly dreams the awful visions of the Apocalypse, one might have
imagined easily that the pure, saintly, and childlike evangelist had
been once again recalled to this earth, and that this most quiet of
mansions was some cell in the island of Patmos. Whence came the
stained glass of the windows I know not, and whether it were
stained or painted. The revolutions of that art are known from
Horace Walpole's account; and, nine years after this period, I found
that, in Birmingham, where the art of staining glass was chiefly
practised, no trifling sum was charged even for a vulgar lacing of no
great breadth round a few drawing-room windows, which one of my
friends thought fit to introduce as an embellishment. These
windows, however, of my clerical friend were really "storied
windows," having Scriptural histories represented upon them. A
crowning ornament to the library or principal room was a sweet-
toned organ, ancient, and elaborately carved in its wood-work, at
which my venerable friend readily sate down, and performed the
music of anthems as often as I asked him, sometimes accompanying
it with his voice, which was tremulous from old age, but neither
originally unmusical, nor (as might be perceived) untrained.
Often, from the storms and uproars of this world, I have looked back
upon this most quiet and, I believe, most innocent abode (had I said
saintly I should hardly have erred), conneacting it in thought with
Little Gidding, the famous mansion (in Huntingdonshire, I believe) of
the Farrers, an interesting family in the reigns of James I. and
Charles I. Of the Farrers there is a long and circumstantial
biographical account, and of the conventual discipline maintained at
Little Gidding. For many years it was the rule at Gidding—and it was
the wish of the Farrers to have transmitted that practice through
succeeding centuries—that a musical or cathedral service should be
going on at every hour of night and day in the chapel of the
mansion. Let the traveller, at what hour he would, morning or
evening, summer or winter, and in what generation or century
soever, happen to knock at the gate of Little Gidding, it was the
purpose of Nicholas Farrer—a sublime purpose—that always he
should hear the blare of the organ, sending upwards its surging
volumes of melody, God's worship for ever proceeding, anthems of
praise for ever ascending, and jubilates echoing without end or
known beginning. One stream of music, in fact, never intermitting,
one vestal fire of devotional praise and thanksgiving, was to connect
the beginnings with the ends of generations, and to link one century
into another. Allowing for the sterner asceticism of N. Farrer—partly
arising out of the times, partly out of personal character, and partly,
perhaps, out of his travels in Spain—my aged friend's arrangement
of the day, and the training of his household, might seem to have
been modelled on the plans of Mr. Farrer; whom, however, he might
never have heard of. There was also, in each house, the same union
of religion with some cultivation of the ornamental arts, or some
expression of respect for them. In each case, a monastic severity,
that might, under other circumstances, have terminated in the
gloom of a La Trappe, had been softened by English sociality, and by
the habits of a gentleman's education, into a devotional pomp,
reconcilable with Protestant views. When, however, remembering
this last fact in Mr. Clowes's case (the fact I mean of his liberal
education), I have endeavoured to explain the possibility of one so
much adorned by all the accomplishments of a high-bred gentleman,
and one so truly pious, falling into the grossness, almost the
sensuality, which appears to besiege the visions of Swedenborg, I
fancy that the whole may be explained out of the same cause which
occasionally may be descried, through a distance of two complete
centuries, as weighing heavily upon the Farrers—viz. the dire
monotony of daily life, when visited by no irritations either of hope
or fear—no hopes from ambition, no fears from poverty.
Nearly (if not quite) sixty years did my venerable friend inhabit that
same parsonage house, without any incident more personally
interesting to himself than a cold or a sore throat. And I suppose
that he resorted to Swedenborg—reluctantly, perhaps, at the first—
as to a book of fairy tales connected with his professional studies.
And one thing I am bound to add in candour, which may have had
its weight with him, that more than once, on casually turning over a
volume of Swedenborg, I have certainly found most curious and
felicitous passages of comment—passages which extracted a brilliant
meaning from numbers, circumstances, or trivial accidents,
apparently without significance or object, and gave to things,
without a place or a habitation in the critic's regard, a value as
hieroglyphics or cryptical ciphers, which struck me as elaborately
ingenious. This acknowledgment I make not so much in praise of
Swedenborg, whom I must still continue to think a madman, as in
excuse for Mr. Clowes. It may easily be supposed that a person of
Mr. Clowes's consideration and authority was not regarded with
indifference by the general body of the Swedenborgians. At his
motion it was, I believe, that a society was formed for procuring and
encouraging a translation into English of Swedenborg's entire works,
most of which are written in Latin. Several of these translations are
understood to have been executed personally by Mr. Clowes; and in
this obscure way, for anything I know, he may have been an
extensive author. But it shows the upright character of the man that
never, in one instance, did he seek to bias my opinions in this
direction. Upon every other subject, he trusted me confidentially—
and, notwithstanding my boyish years (15-16), as his equal. His
regard for me, when thrown by accident in his way, had arisen upon
his notice of my fervent simplicity, and my unusual thoughtfulness.
Upon these merits, I had gained the honourable distinction of a
general invitation to his house, without exception as to days and
hours, when few others could boast of any admission at all. The
common ground on which we met was literature—more especially
the Greek and Roman literature; and much he exerted himself, in a
spirit of the purest courtesy, to meet my animation upon these
themes. But the interest on his part was too evidently a secondary
interest in me, for whom he talked, and not in the subject: he spoke
much from memory, as it were of things that he had once felt, and
little from immediate sympathy with the author; and his animation
was artificial, though his courtesy, which prompted the effort, was
the truest and most unaffected possible.
The connexion between us must have been interesting to an
observer; for, though I cannot say with Wordsworth, of old Daniel
and his grandson, that there were "ninety good years of fair and foul
weather" between us, there were, however, sixty, I imagine, at the
least; whilst as a bond of connexion there was nothing at all that I
know of beyond a common tendency to reverie, which is a bad link
for a social connexion. The little ardour, meantime, with which he
had, for many years, participated in the interests of this world, or all
that it inherits, was now rapidly departing. Daily and consciously he
was loosening all ties which bound him to earlier recollections; and,
in particular, I remember—because the instance was connected with
my last farewell visit, as it proved—that for some time he was
engaged daily in renouncing with solemnity (though often enough in
cheerful words) book after book of classical literature in which he
had once taken particular delight. Several of these, after taking his
final glance at a few passages to which a pencil reference in the
margin pointed his eye, he delivered to me as memorials in time to
come of himself. The last of the books given to me under these
circumstances was a Greek "Odyssey," in Clarke's edition. "This,"
said he, "is nearly the sole book remaining to me of my classical
library—which, for some years, I have been dispersing amongst my
friends. Homer I retained to the last, and the 'Odyssey,' by
preference to the 'Iliad,' both in compliance with my own taste, and
because this very copy was my chosen companion for evening
amusement during my freshman's term at Trinity College, Cambridge
—whither I went early in the spring of 1743. Your own favourite
Grecian is Euripides; but still you must value—we must all value—
Homer. I, even as old as I am, could still read him with delight; and,
as long as any merely human composition ought to occupy my time,
I should have made an exception in behalf of this solitary author. But
I am a soldier of Christ; the enemy, the last enemy, cannot be far
off; sarcinas colligere is, at my age, the watchword for every faithful
sentinel, hourly to keep watch and ward, to wait and to be vigilant.
This very day I have taken my farewell glance at Homer, for I must
no more be found seeking my pleasure amongst the works of man;
and, that I may not be tempted to break my resolution, I make over
this my last book to you."
Words to this effect, uttered with his usual solemnity, accompanied
his gift; and, at the same time, he added, without any separate
comment, a little pocket Virgil—the one edited by Alexander
Cunningham, the bitter antagonist of Bentley—with a few
annotations placed at the end. The act was in itself a solemn one;
something like taking the veil for a nun—a final abjuration of the
world's giddy agitations. And yet to him—already and for so long a
time linked so feebly to anything that could be called the world, and
living in a seclusion so profound—it was but as if an anchorite should
retire from his outer to his inner cell. Me, however, it impressed
powerfully in after years; because this act of self-dedication to the
next world, and of parting from the intellectual luxuries of this, was
also, in fact, though neither of us at the time knew it to be such, the
scene of his final parting with myself. Immediately after his solemn
speech, on presenting me with the "Odyssey," he sat down to the
organ, sang a hymn or two, then chanted part of the liturgy, and,
finally, at my request, performed the anthem so well known in the
English Church service—the collect for the seventh Sunday after
Trinity—(Lord of all power and might, &c.) It was summer—about
half after nine in the evening; the light of day was still lingering, and
just strong enough to illuminate the Crucifixion, the Stoning of the
Protomartyr, and other grand emblazonries of the Christian faith,
which adorned the rich windows of his library. Knowing the early
hours of his household, I now received his usual fervent adieus—
which, without the words, had the sound and effect of a benediction
—felt the warm pressure of his hand, saw dimly the outline of his
venerable figure, more dimly his saintly countenance, and quitted
that gracious presence, which, in this world, I was destined no more
to revisit. The night was one in the first half of July 1802; in the
second half of which, or very early in August, I quitted school
clandestinely, and consequently the neighbourhood of Mr. Clowes.
Some years after, I saw his death announced in all the public
journals, as having occurred at Leamington Spa, then in the
springtime of its medicinal reputation. Farewell, early friend! holiest
of men whom it has been my lot to meet! Yes, I repeat, thirty-five
years are past since then, and I have yet seen few men approaching
to this venerable clergyman in paternal benignity—none certainly in
child-like purity, apostolic holiness, or in perfect alienation of heart
from the spirit of this fleshly world.
I have delineated the habits and character of Mr. Clowes at some
length, chiefly because a connexion is rare and interesting between
parties so widely asunder in point of age—one a schoolboy, and the
other almost an octogenarian, to quote a stanza from one of the
most spiritual sketches of Wordsworth—
I have stated a second reason for this record, in the fact that Mr.
Clowes was the first of my friends who had any connexion with the
press. At one time I have reason to believe that this connexion was
pretty extensive, though not publicly avowed, and so far from being
lucrative that at first I believe it to have been expensive to him, and
whatever profits might afterwards arise were applied, as much of his
regular income, to the benefit of others.[23] Here, again, it seems
surprising that a spirit so beneficent and, in the amplest sense,
charitable, could coalesce in any views with Swedenborg, who, in
some senses, was not charitable. Swedenborg had been scandalized
by a notion which, it seems, he found prevalent amongst the poor of
the Continent—viz., that, if riches were a drag and a negative force
on the road to religious perfection, poverty must be positive title per
se to the favour of Heaven. Grievously offended with this error, he
came almost to hate poverty as a presumptive indication of this
offensive heresy; scarcely would he allow it an indirect value, as
removing in many cases the occasions or incitements of evil. No:
being in itself neutral and indifferent, he argued that it had become
erroneously a ground of presumptuous hope; whilst the rich man,
aware of his danger, was, in some degree, armed against it by fear
and humility. And, in this course of arguing and of corresponding
feeling, Mr. Swedenborg had come to hate the very name of a poor
candidate for Heaven, as bitterly as a sharking attorney hates the
applications of a pauper client. Yet so entirely is it true that "to the
pure, all things are pure," and that perfect charity "thinketh no ill,"
but is gifted with a power to transmute all things into its own
resemblance—so entirely is all this true, that this most spiritual, and,
as it were, disembodied of men, could find delight in the dreams of
the very "fleshliest incubus" that has intruded amongst heavenly
objects; and, secondly, this benignest of men found his own pure
feelings not outraged by one who threw a withering scowl over the
far larger half of his fellow-creatures.
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.
ebookname.com