Data Structures With C Programming 2nd Edition Anil Kumar Yadav pdf download
Data Structures With C Programming 2nd Edition Anil Kumar Yadav pdf download
https://ebookbell.com/product/data-structures-with-c-
programming-2nd-edition-anil-kumar-yadav-55547078
Data Structures With C Programming Yadav Anil Kumar Yadav Vinod Kumar
https://ebookbell.com/product/data-structures-with-c-programming-
yadav-anil-kumar-yadav-vinod-kumar-55536752
https://ebookbell.com/product/introduction-to-programming-and-data-
structures-with-c-4e-y-daniel-liang-liang-35190274
https://ebookbell.com/product/programming-with-c-and-introduction-to-
data-structures-kogent-learning-solutions-inc-231673806
Data Structures With C Using Stl 2nd Edition William H Ford William R
Topp
https://ebookbell.com/product/data-structures-with-c-using-stl-2nd-
edition-william-h-ford-william-r-topp-46638186
Data Structures And Algorithms With C Pal Debdutta Halder Suman
https://ebookbell.com/product/data-structures-and-algorithms-with-c-
pal-debdutta-halder-suman-10525336
Data Structures And Algorithms With The C Stl A Guide For Modern C
Practitioners 1 Converted John Farrier
https://ebookbell.com/product/data-structures-and-algorithms-with-the-
c-stl-a-guide-for-modern-c-practitioners-1-converted-john-
farrier-55889290
https://ebookbell.com/product/data-structures-a-pseudocode-approach-
with-c-2nd-edition-richard-f-gilberg-behrouz-a-forouzan-33554888
https://ebookbell.com/product/data-structures-a-pseudocode-approach-
with-c-2nd-edition-richard-f-gilberg-behrouz-a-forouzan-37448042
Adts Data Structures And Problem Solving With C 2nd Edition 2nd
Edition Larry R Nyhoff
https://ebookbell.com/product/adts-data-structures-and-problem-
solving-with-c-2nd-edition-2nd-edition-larry-r-nyhoff-2253698
DATA STRUCTURES WITH C
PROGRAMMING
DATA STRUCTURES WITH C
PROGRAMMING
ARCLER
P r e s s
www.arclerpress.com
Data Structures with C Programming
Dr. Anil Kumar Yadav and Vinod Kumar Yadav
Arcler Press
2010 Winston Park Drive,
2nd Floor
Oakville, ON L6H 5R7
Canada
www.arclerpress.com
Tel: 001-289-291-7705
001-905-616-2116
Fax: 001-289-291-7601
Email: orders@arclereducation.com
This book contains information obtained from highly regarded resources. Reprinted material
sources are indicated and copyright remains with the original owners. Copyright for images and
other graphics remains with the original owners as indicated. A Wide variety of references are
listed. Reasonable efforts have been made to publish reliable data. Authors or Editors or Publish-
ers are not responsible for the accuracy of the information in the published chapters or conse-
quences of their use. The publisher assumes no responsibility for any damage or grievance to the
persons or property arising out of the use of any materials, instructions, methods or thoughts in
the book. The authors or editors and the publisher have attempted to trace the copyright holders
of all material reproduced in this publication and apologize to copyright holders if permission has
not been obtained. If any copyright holder has not been acknowledged, please write to us so we
may rectify.
Notice: Registered trademark of products or corporate names are used only for explanation and
identification without intent of infringement.
Arcler Press publishes wide variety of books and eBooks. For more information about
Arcler Press and its products, visit our website at www.arclerpress.com
ABOUT THE AUTHORS
Dr. Anil Kumar Yadav has done his B.Tech (CSE), M.Tech (I.T)
and PhD (Computer Science and Engineering) in the area of Machine
Learning specialization in Reinforcement Learning and Artificial
Intelligence. He has filed patent on topic Machine Learning, “Method
for Reinforcement Learning,”. He has been teaching data structures and
Artificial intelligence over the last 13 years at under graduate and post
graduate levels. With over a decade of teaching experience in the
engineering institutions, he has exemplified his work at various
designations. His research interests include data structures, deep
learning , machine learning algorithms specially reinforcement
learning, computational intelligence, computer vision and image
processing, brain computer/machine interface, intelligent informatics, soft-
computing in modeling and control, cognitive science. He has presented
papers at national and international conferences and published several
papers in international journals and also attended several workshops. He is
also a reviewer of some of the international journal and conferences.
Vinod Kumar Yadav has done his B.Tech (I.T), M.Tech (CSE). His area
of interest is Data mining, Artificial Intelligence and Machine Learning. He
has been teaching data structures over the last 7 years at under graduate and
post graduate levels. He is also GATE Qualified in Information Technology
in 2007. He has published many papers at national, international conferences
and international Journals. He also attended several national workshops.
TABLE OF CONTENTS
List of Figures.................................................................................................xi
Preface.................................................................................................... ....xvii
Chapter 2 Array........................................................................................................ 35
2.1. Introduction....................................................................................... 36
2.2. Application of Array........................................................................... 36
2.3. Definition of Array............................................................................. 37
2.4. Representation of Array...................................................................... 37
2.5. Ordered List....................................................................................... 56
2.6. Sparse Matrices.................................................................................. 57
2.7. Garbage Collection............................................................................ 60
Chapter 3 Recursion................................................................................................. 63
3.1. Introduction....................................................................................... 64
3.2. Recursion.......................................................................................... 64
3.3. Tower of Hanoi ................................................................................. 72
3.4. Backtracking ..................................................................................... 74
Chapter 4 Stack........................................................................................................ 77
4.1. Introduction....................................................................................... 78
4.2. Definition of Stack............................................................................. 78
4.3. Operations on Stack.......................................................................... 80
4.4. Disadvantages of Stack...................................................................... 94
4.5. Applications of Stack......................................................................... 94
4.6. Expressions (Polish Notation)............................................................. 95
4.7. Evaluation of Postfix Expression......................................................... 98
4.8. Decimal To Binary Conversion........................................................... 99
4.9. Reversing The String......................................................................... 102
viii
Chapter 8 Graph..................................................................................................... 213
8.1. Introduction..................................................................................... 214
8.2. Definition of Graph......................................................................... 214
8.3. Representation of Graphs................................................................. 221
8.4. Graph Traversal................................................................................ 224
8.5. Spanning Tree.................................................................................. 229
8.6. Shortest Path Problem...................................................................... 240
8.7. Application Of Graph...................................................................... 243
Index...................................................................................................... 309
ix
LIST OF FIGURES
xi
Figure 2.4 Output of Program 2.3.
Figure 2.5 Array positions.
Figure 2.6 3 x 4 array two-dimensional.
Figure 2.7 Row major store in an array.
Figure 2.8 Column major store in an array.
Figure 2.9 Output of Program 2.4.
Figure 2.10 Output of Program 2.5
Figure 2.11 Output of Searching.
Figure 2.12 Output of Program Insertion.
Figure 2.13 Output of Program Deletion.
Figure 2.14 Output of Program Deletion.
Figure 2.15 Polynomial representation.
Figure 2.16 Sparse matrix.
Figure 2.17 Output of Sparse Matrix or not.
Figure 3.1 Output of a Factorial number Using Iteration Method.
Figure 3.2 Output of a Factorial number Using Recursion Method.
Figure 3.3 Output of Fibonacci Series.
Figure 3.4 Output for Check Prime number.
Figure 3.5 Initial Setup of Tower of Hanoi
Figure 3.6 After applying first Step position of Tower
Figure 3.7 After applying second step position of tower
Figure 3.8 After applying third step position of tower.
Figure 3.9 After applying fourth step position of tower.
Figure 3.10 Tree Example.
Figure 4.1 Stack Containing Items.
Figure 4.2 Stack using a 1-dimensional array.
Figure 4.3 Stack empty condition
Figure 4.4 Stack full condition.
Figure 4.5 Performing Push Operation.
Figure 4.6 Performing Pop Operation.
Figure 4.7 Stack Operation.
xii
Figure 4.8 Output Example 4.1.
Figure 4.9 Output of stack operation using linked list.
Figure 4.10 Output of Decimal to Binary
Figure 4.11 Output Reverse a String.
Figure 5.1 Queue structure.
Figure 5.2 Array Implementation of Queue.
Figure 5.3 (a) Queue in Memory.
Figure 5.3 (b) Queue after deleting the first element.
Figure 5.3 (c) Queue after inserting an element.
Figure 5.4 Output of Queue Operations.
Figure 5.5 Output of Queue operation using Linked List.
Figure 5.6 Linear Queue.
Figure 5.7 Circular Queue.
Figure 5.8 Output of Circular Queue Operations
Figure 5.9 D-Queue.
Figure 5.10 (a) Input-restricted D-queue.
Figure 5.10 (b) Output-restricted D-queue.
Figure 5.11 Output of D-Queue Operations.
Figure 5.12 Output of Priority Queue.
Figure 6.1 Structure of a Node
Figure 6.2 Representation of link list.
Figure 6.3 Output of Linked List.
Figure 6.4 A singly-linked list containing three integer values.
Figure 6.5 Output of Single linked list operations.
Figure 6.6 Output of Circular Linked List Operations.
Figure 6.7 Doubly Linked List.
Figure 6.8 Output of Doubly linked list Operations.
Figure 6.9 Structure of a polynomial node.
Figure 6.10 List structure of polynomial.
Figure 6.11 Linked representation of a polynomial two variable.
Figure 7.1 Tree.
Figure 7.2 a, b and c represent a forest.
xiii
Figure 7.3 An example of Tree.
Figure 7.4 Binary tree.
Figure 7.5 Strictly Binary Tree
Figure 7.6 Almost Complete.
Figure 7.7 Complete Binary Tree.
Figure 7.8 Extended Binary Tree.
Figure 7.9 (a) Left -skewed binary tree (b) Right – skewed binary tree.
Figure 7.10 General Tree.
Figure 7.11 Expression Tree.
Figure 7.12 Sequential representation of a binary tree.
Figure 7.13 Structure of a node binary tree.
Figure 7.14 Linked List Representation.
Figure 7.15 Binary Tree (a) and (b).
Figure 7.16 Binary Tree (a) and (b).
Figure 7.17 Binary Tree (a) and (b).
Figure 7.18 Finally Binary Tree.
Figure 7.19 Computing pointer in a binary tree.
Figure 7.20 A threaded binary tree.
Figure 7.21 Binary Search Tree.
Figure 7.22 Binary Search Tree.
Figure 7.23 Before deletion.
Figure 7.24 After deletion.
Figure 7.25 Before deletion.
Figure 7.26 After deletion of a node from the tree.
Figure 7.27 Before deletion.
Figure 7.28 After the deletion of a node from the tree.
Figure 7.29 Red-Black Tree.
Figure 7.30 AVL tree.
Figure 7.31 Not an AVL tree.
Figure 7.32 Classification of Rotation.
Figure 7.33 Balanced AVL search tree.
Figure 7.34 AVL search tree after performing LL rotation.
xiv
Figure 7.35 Balanced AVL search tree.
Figure 7.36 AVL search tree after performing RR rotation
Figure 7.37 Balanced AVL search tree.
Figure 7.38 AVL search tree after performing LR rotation.
Figure 7.39 Balanced AVL search tree.
Figure 7.40 AVL search tree after performing RL rotation.
Figure 7.41 AVL tree Exercise of 7.4
Figure 7.42 Weight Balance Tree.
Figure 8.1 Simple Graph.
Figure 8.2 A Directed Graph.
Figure 8.3 An Undirected Graph.
Figure 8.4 A Complete Graph.
Figure 8.5 A Sub Graph.
Figure 8.6 A connected graph.
Figure 8.7 A Multigraph.
Figure 8.8 A Graph with four Vertices.
Figure 8.9 A directed graph with four Vertices.
Figure 8.10 A Null Graph.
Figure 8.11 An Isomorphic Graph.
Figure 8.12 A Homeomorphic Graph.
Figure 8.13 An Undirected Graph.
Figure 8.14 A Directed Graph.
Figure 8.15 Linked list representation of Figure 8.14.
Figure 8.16 An Undirected Graph.
Figure 8.17 Linked list of Figure 8.16.
Figure 8.18 Graph with six vertices.
Figure 8.19 An undirected graph.
Figure 8.20 An undirected graph.
Figure 8.21 An undirected graph.
Figure 8.22(a) Undirected Graph.
Figure 8.22(b) Spanning Tree.
Figure 8.23 Undirected Graph.
xv
Figure 8.24 Minimum spanning tree Graph of 8.23.
Figure 8.25 Undirected Graph G.
Figure 8.26 A Minimum Spanning tree of Figure 8.25.
Figure 8.27 Undirected Graph G.
Figure 8.28 Undirected Graph G.
Figure 8.29 A Minimum Spanning tree of Figure 8.27
Figure 8.30 Unweighted graph
Figure 8.31 A Graph.
Figure 9.1 Output of Bubble Sort.
Figure 9.2 Output of Insertion Sort.
Figure 9.3 Output of Selection Sort.
Figure 9.4 Output of Merge Sort element.
Figure 9.5 Output of merge sort for two unsorted list.
Figure 9.6 Quick Sort.
Figure 9.7 Output of Quick Sort element.
Figure 9.8 Output of Heap Sort.
Figure 9.9 Output of Radix sort elements.
Figure 10.1 Output for Binary search.
Figure 10.2 A small phone directory book as a hash table.
Figure 10.3 Chaining.
Figure 10.4 Rehashing.
xvi
PREFACE
The significant role of Data Structures is famous for Computer Science and
Engineering. This book is about the structure, actions and the principle of a
different data type that help improve the ability to write an efficient algorithm,
program and Analysis algorithm and program complexity. In this book, we
present the fundamental concepts, operations, and algorithms for different types
of data structures. This makes an understanding of this subject more lucid and
makes it more interesting. This book, intended for the first course in the data
structure at the junior or senior undergraduate level.
This book prepared according to the syllabus of various Universities and
conceived as a textbook for the course of Bachelor of Engineering or Technology
of different branches of computer science. The contents of the book have been
thoroughly organized and spread over ten chapters. Each chapter begins with
the basics and describes with syntax, diagrams, and examples. Each concept
of data structure has implemented in the C programming language. The book
not only covers the scope of the subject but also explains the philosophy of the
subject.
We trust the textbook would meet the requirements of both the teachers and
the students. We would very much appreciate receiving any suggestions for
improvement in the book from teachers, students, and other readers.
We wish to express our deep thanks to all those who helped in making this book
a reality.
We express our gratitude to our publisher and the team of publications that have
taken great pains in publishing the book with speed and accuracy.
1
CHAPTER
DATA STRUCTURES
CONTENTS
1.1. Introduction......................................................................................... 2
1.2. Data Structure Basic Terminology........................................................ 2
1.3. Data Structure...................................................................................... 3
1.4. Introduction To Algorithm.................................................................... 8
1.5. Basic Concept of Function................................................................. 13
1.6. Basic Concept of Pointers.................................................................. 19
1.7. Introduction To Structure.................................................................... 22
1.8. Dynamic Memory Allocation In Data Structure................................. 28
2 Data Structures with C Programming
1.1. INTRODUCTION
In the Computer Programming or Software development, Data Structures is
one of the most valuable roles for computer engineers. Use of appropriate
data structures enables a computer system to perform its task more efficiently,
by influencing the ability of computers to store and retrieve data from any
location in its memory. A data structure is a method of how storing data on
a computer so that it can be used efficiently. In Computer Programming we
are using different types of data to perform, store, access and sent data and
information. Computers cannot do without data, so organizing that data is
very important. If that data is not organized effectively, it is very difficult to
perform any task on that data. If it is organized effectively then any operation
can be performed easily on that data.
The time and space are factors which determine the efficiencies of the
program. The time required for execution of the program cannot be computed
in terms of seconds because of the following factors.
1. The hardware of the machine.
2. The amount of time required by each machine instruction.
3. The amount of time required by the compilers to execute the
instruction.
4. The instruction set.
Efficiency of Algorithms
If we have two algorithms that perform the same task, and the first one has
a computing time of O(n) and the second of O(n2), then will usually prefer
the first one. The reason for this is that as n increases the time required for
the execution of second algorithms will get far more than the time required
for the execution of the first. We will study various values for computing
function for the constant values.
log2n > n > n log2n > n2 > n3 > 2n
Notice how the times O(n) and O(n log2 n) grow much more slowly
than the others. For large datasets algorithms with a complexity greater than
O(n log2 n) are often impractical. The very slow algorithm will be the one
having time complexity 2n.
{
return a + b;
}
Here, the data type is the type of pointers it must be valid in C data and
variable_name is the name of the pointer variable. The asterisk * used to
declare a pointer.
Some examples are given that are the valid pointer declarations:
int *i; /* pointer to an integer */
float *f; /* pointer to a float */
char *c /* pointer to a character */
The * symbol informs the compiler that we use a pointer variable, the
actual data type of the value of all pointers.
#include<conio.h>
void main ()
{
clrscr();
int a = 20; /* actual variable declaration */
int *ip; /* pointer variable declaration */
ip = &a; /* store address of a in pointer variable*/
printf(“\nAddress of a variable: %x\n,” &a); /*address stored in pointer
variable*/
printf(“\nAddress stored in ip variable: %x\n,” ip); /*access value using
pointer */
printf(“\nValue of *ip variable: %d\n,” *ip);
getch();
}
The output of the program is given in Figure 1.16.
namely Bookname, Authorname, volume, and price. These fields are called
structure elements or members. Each data member can have a different
data type, like Bookname and Author name is of char type, the volume is int
type and price is of float type etc. The library is the name of the structure
and is called structure tag.
float price;
} L1, L2;
L1.price = 200.50; //L1 is variable of Library type and the price is a mem-
ber of Library
We can also use scanf() to give values to structure members through the
terminal.
scanf(“ %s ,” L1.Bookname);
scanf(“ %d ,” &L1.price);
printf(“Enter information:\n”);
printf(“Enter Book Name: “);
scanf(“%s,” l.Bookname);
printf(“\nEnter Author Name:”);
scanf(“%s,”l.Authorname);
printf(“\n Enter volume number: “);
scanf(“%d,” &l.volume);
printf(“\n Enter Price of Book: “);
scanf(“%f,” &l.price);
printf(“\nDisplaying Information:\n”);
printf(“Book Name: “);
puts(l.Bookname);
printf(“Author name: %s\n,”l.Authorname);
printf(“Volume: %d\n,” l.volume);
printf(“Price: %f \n,” l.price);
getch(); }
The output of the program is given in Figure 1.18.
members of a structure using a pointer to that structure, you must use the →
operator as follows:
struct_pointer→ title;
}
void main()
{
clrscr ();
getdata();
getch();
}
The output of the program is given in Figure 1.20.
which had charmed the ear and cheated the memory of Scott (I think it was)
till he mistook it for his own. We had the ‘Star Spangled Banner,’ and two
or three naval ballads which, to my ear, have the true rough and ready tone.
Philip Cook, of Virginia, had written a few graceful and musical lyrics. We
had ‘McFingal,’ as near its model as any imitation of the inimitable can be,
but far indeed from that intricate subtlety of wit which makes ‘Hudibras’ a
metaphysical study as well as an intellectual delight. We had in the
‘Federalist’ a mine of political wisdom by which even Burke might have
profited, and whose golden veins are not yet exhausted, as foreign statists
and jurists are beginning to discover. But of true literature we had next to
nothing. Of what we had, Duyckinck’s scholarly ‘Cyclopædia of American
Literature’ gives us an almost too satisfactory notion. Of what we had not,
there was none to tell us, for there were no critics. We had no national unity,
and therefore no national consciousness, and it is one of the first conditions
of a virile and characteristic literature that it should feel solid and familiar
earth under its feet. New England had indeed a kind of unity, but it was a
provincial unity, and those hardy commonwealths that invented democracy
were not and could not yet be quite in sympathy with the new America that
was to adopt and expand it. Literature thrives in an air laden with tradition,
in a soil ripe with immemorial culture, in the temperature, steady and
stimulating, of historic associations. We had none of these. What semblance
we had of them was English, and we long continued to bring earth from the
mother-country to pot our imported plants with, as the crusaders brought
home that of Palestine to be buried in. And all this time our native oak was
dropping its unheeded acorns into the crannies of the rock where by and by
their sturdy roots would make room for themselves and find fitting
nourishment.
“Never was young nation on its way to seek its fortune so dumfounded
as Brother Jonathan when John Bull, presenting what seemed to his startled
eyes a blunderbuss, cried gruffly from the roadside, ‘Stand, and deliver a
literature!’ He was in a ‘pretty fix,’ as he himself would have called it. After
fumbling in all his pockets, he was obliged to confess that he hadn’t one
about him at the moment, but vowed that he had left a beautiful one at
home which he would have fetched along—only it was so everlasting
heavy. If he had but known it, he carried with him the pledge of what he
was seeking in that vernacular phrase ‘fix,’ which showed that he could
invent a new word for a new need without asking leave of anybody.
“Meanwhile the answer to Sydney Smith’s scornful question was
shaping itself. Already we had Irving, who after humorously satirizing the
poverty of our annals in his ‘Knickerbocker,’ forced to feel the pensive
beauty of what is ancient by the painful absence of it, first tried to create an
artificial antiquity as a substitute, and then sought in the old world a
kindlier atmosphere and themes more sympathetic with the dainty and
carefully shaded phrase he loved. He first taught us the everliving charm of
style, most invaluable and most difficult of lessons. Almost wholly English,
he is yet our earliest classic, still loved in the Old Home and the New. Then
came Cooper, our first radically American author, with the defects of style
that come of half-culture, but a man of robust genius who, after a false start,
looked about him to recognize in the New Man of the New World an
unhackneyed and unconventional subject for Art. Brockden Brown had
shown vivid glimpses of genius, but of a genius haunted by the phantasms
of imagination and conscious of those substantial realities they mocked
only as an opium eater might be. His models were lay figures shabby from
their long service in the studios of Godwin and the Germans. Cooper first
studied from the life, and it was the homo Americanus with our own
limestone in his bones, our own iron in his blood, that sat to him. There had
been pioneers before him, like Belknap and Breckenridge, who had, in
woodman’s phrase, blazed the way for him, but he found new figures in the
forest, autochthonous figures, and on the ocean, whose romance he was the
first to divine, he touched a nerve of patriotic pride that still vibrates. I open
upon my boyhood when I chance on a page of his best. In prose we had also
Channing, who uttered the perceptions, at once delicate and penetrating like
root fibres, of a singularly intuitive mind in a diction of sober fervor where
the artist sometimes elbows aside the preacher; and Webster, the massive
simplicity of whose language and the unwavering force of whose argument,
flashing into eloquent flame as it heated, recalled to those who listened and
saw before them one of the most august shapes manhood ever put on, no
inadequate image of Pericles. We had little more. Emerson was still letting
grow or trying in short flights those wings that were to lift him and us to
Heaven’s sweetest air. Hawthorne, scarce out of his teens, had given in
‘Fanshawe’ some inkling of his instinct for style and of the direction his
maturer genius was to choose, but no glimpse of that creative imagination,
the most original and profound of these latter days. Our masters of
historical narration were yet to come.
“In poetry we were still to seek. Byrant’s ‘Waterfowl’ had begun that
immortal flight that will be followed by many a delighted eye long after
ours shall have been darkened; Dana had written some verses which
showed a velleity for better and sincerer things; Willis was frittering away a
natural and genuine gift; Longfellow was preluding that sweet, pure, and
sympathetic song which persuaded so many Englishmen that he must be a
countrymen of theirs. In his case the question certainly became not ‘Who
reads an American book?’ but ‘Who does not read one?’ Holmes had
written one imperishable poem.
“This was the state of things when I was a boy. That old question, once
so cruelly irritating, because it was so cruelly to the point, has long ago lost
its sting. When I look round me on this platform, I see a company of
authors whose books are read wherever English is read, and some whose
books are read in languages that are other than their own. The American
who lounges over an English railway-book-stall while his train is making-
up sees almost as many volumes with names of his countrymen on their
backs as he sees of native authors. American Literature has asserted and
made good its claim to a definite place in the world. Sixty years ago there
were only two American authors, Irving and Cooper, who could have lived
by their literary incomes, and they fortunately had other sources of revenue.
There are now scores who find in letters a handsome estate. Our literature
has developed itself out of English literature, as our political forms have
developed themselves out of English political forms, but with a difference.
Not as parasitic plants fed from the parent stock, but only as new growths
from seeds the mother tree has dropped, could they have prospered as they
have done. And so our literature is a part of English literature and must
always continue to be so, but, as I have said, with a difference. What that
difference is, it would be very hard to define, though it be something of
which we are very sensible when we read an American book. We are, I
think, especially sensible of it in the biography of any of our countrymen, as
I could not help feeling as I read that admirable one of Emerson by Mr.
Cabot. There was nothing English in the conditions which shaped the earlier
part of Emerson’s life. Something Scottish there was, it may be said, but the
later life at Concord which was so beautiful in its noble simplicity, in its
frugality never parsimonious, and practised to secure not wealth but
independence, that is—or must we say was?—thoroughly American.
Without pretension, without swagger, with the need of proclaiming itself,
and with no affectation of that commonness which our late politicians seem
to think especially dear to a democracy, it represented whatever was
peculiar and whatever was best in the novel inspirations of our soil. These
inspirations began to make themselves felt early in our history and I think I
find traces of their influence even so long ago as the ‘Simple Cobbler of
Agawam,’ published in 1647. Its author, Ward, had taken his second degree
at Cambridge and was a man past middle life when be came over to
Massachusetts, but I think his book would have been a different book had
he written it in England. This Americanism which is there because we
cannot help it, not put there because it is expected of us, gives, I think, a
new note to our better literature and is what makes it fresh and welcome to
foreign ears. We have developed, if we did not invent, a form of racy,
popular humor, as original as it is possible for anything to be, which has
found ideal utterance through the genius of ‘Mark Twain.’ I confess that I
look upon this general sense of the comic among our people and the ready
wit which condenses it into epigram, as one of the safeguards of our polity.
If it be irreverent it is not superstitious; it has little respect for phrases; and
no nonsense can long look it in the eye without flinching.”
“Heartsease and Rue” was published in the early spring of 1888 and
immediately afterward Lowell printed in the Atlantic his poem “Turner’s
Old Téméraire, under a Figure symbolizing the Church.” This poem and
“How I consulted the Oracle of the Goldfishes,” which appeared in the
Atlantic for August, 1889, were printed in the thin posthumous volume of
“Last Poems,” and belong thus in the group which most effectively
represents Lowell’s mood on the profoundest themes at the end of his life.
The first poem in “Heartsease and Rue,” that on Agassiz, which heads the
section entitled Friendship, has already been noted in connection with the
time when it was written. A little of the same pathos of parting with old
friends is in the postscript of the letter to Curtis, and in this as in the former,
the poet’s mind runs on naturally in its speculation to the new To Be. A
single hint of a thought which filled many of Lowell’s hours occurs in the
poem when he says:—
but it is in the group of poems referred to above that one sees most clearly a
recurrence to the great underlying questions of faith. With a half-mocking
smile Lowell asks in “Credidimus Jovem regnare” if science has found the
key which religion has lost, and falls back on the somewhat lame
conclusion that he had best keep his key, which may be but a rusty
inheritance, on the chance that the door and lock may some day be made to
fit the key. Again, in the poem “How I consulted the Oracle of the
Goldfishes,” where he muses over the realities and illusions of the spiritual
world, he does not deny the doubts that have arisen in his own mind, but
after all refuses to permit even his doubts to dismay him.
“Here shall my resolution be:
The shadow of the mystery
Is haply wholesomer for eyes
That cheat us to be over-wise,
And I am happy in my sight
To love God’s darkness as His light.”
Nor will he allow himself, even when contemplating what he regards as the
obscuration of the Church’s light, to look upon this as the last state of
organic faith. He takes that noble painting by Turner, “The Fighting
Téméraire tugged to her last berth, to be broken up,” and sees science, “a
black demon, belching fire and steam,” drag it away “to gather weeds in the
regardless stream.” Ruskin makes the picture an unconscious expression by
the painter of his own return to die by the shore of the Thames, “the cold
mists gathering over his strength, and all men crying out against him, and
dragging the old ‘Fighting Téméraire’ out of their way, with dim, fuliginous
contumely;” but surely this is rather the passionate comment of a disciple
making his master’s work prophetic. Lowell’s poem strikes a deeper than a
personal note. It is a fine imaginative conception, a rare interpretation of a
great work of art by another work of art, and what is noticeable in the cry of
the poem is the protest which Lowell, in his instinctive faith, makes against
the finality of his own interpretation. He sees in imagination the splendid
history of the church, and no fighter under Nelson could have witnessed this
desolate funeral of the great ship with more anguish than Lowell has thrown
into his pathetic words; but as the English sailor could have righted himself
with a vision of the glories of the future English navy, so Lowell closes his
dirge with a triumphant prophecy:—
“Shall nevermore, engendered of thy fame,
A new sea-eagle heir thy conqueror name,
And with commissioned talons wrench
From thy supplanter’s grimy clench
His sheath of steel, his wings of smoke and flame?
In taking another great painting as the prompter of his verse, Titian’s so-
called “Sacred and Profane Love,” Lowell again is not so much interpreting
the painter’s thought as he is using the canvas for a mirror in which to read
his own soul, and though in printing “Endymion” he adds the gloss “a
mystical comment,” one may guess that Lowell in this twilight of his life,
musing upon the ideals which had beckoned him from earliest days, still
saw in the heavens that vision of beauty, of truth, and of freedom which had
never been dethroned in his soul. Faithfulness to high emprise,—that at
least he could declare of himself amidst all the doubt that beclouded his
intellectual vision, and it was fitting that the poet should, in this veiled
figure of Endymion, see the reflection of his own face and form.
In sending “Endymion” to his publishers for insertion in the volume
“Heartsease and Rue,” Lowell had written from Deerfoot Farm, 20
December, 1887: “I hoped to have sent this [‘Endymion’] by Monday
morning’s post, but for two days after my return my head continued to be
cloggy and my vein wouldn’t flow. I have at last managed to give what
seems to me as much consecutiveness as they need to what have been a
heap of fragments in my note-books for years. Longer revolution in my
head might round it better, but take it as a meteorolite, splintery still, but
with some metallic iridescence here and there brought from some volcanic
star. Let it come among poems of sentiment, and as the longest, first if
possible.”
He was still looking forward at this time to full labors. He had been
urged by his publishers to undertake the volume on Hawthorne in the
American Men of Letters series. He had signified his assent in general,
some time before, and seemed now to be deliberately contemplating the
task, for he wrote four days after the last:—
“I think there have been one or two volumes published within a few
years about old Salem. I should be glad to have them sent to me at
Southborough. I have one little job of writing to finish, after which I shall
revise my poems and prose for a new edition. I don’t know whether it be
second childhood, but I am beginning to take an interest in them. Then I
mean to take up Hawthorne in earnest....”
Before “Heartsease and Rue” was published Lowell had begun the task
of setting in order all his writings. With some hesitation he published in the
spring of 1888 a volume of “Political Essays,” in which he gathered the
articles printed in the Atlantic and North American Review during the
stormy war period, but he added as the final number his address on “The
Independent in Politics,” given in New York, 13 April, 1888. It may be
noted that, with no apparent definiteness of purpose, Lowell did in the
closing years of his life sum up, in forms which occasions for the most part
suggested, his leading principles and doctrines, as if in a series of
valedictories. Thus “Democracy” was a confession of his fundamental
belief in the region of world-politics; his address at Harvard was the one
word on scholarship which at the end of a scholar’s life he most wished to
say; his address before the Copyright League had touched on points in the
great theme of literature which had been of lifelong interest; in his serious
poetry, as we have seen, he touched upon those great themes of both worlds
which, as a seer of visions all his life, he could not fail to find deepening in
his thought; and now he took the opportunity furnished by a friendly
audience to set forth some of those principles which had formed his rule of
conduct throughout a life that had found active employment in citizenship.
There is no lack of definiteness in this address, and yet the period just
before its delivery, when he may be supposed to have prepared it, was one
of even unwonted depression.
“It isn’t pleasant to think one’s self a failure at seventy,” he wrote 27
March, 1888, “and yet that’s the way it looks to me most of the time. I can’t
do my best. That’s the very torment of it. Why not reconcile one’s self with
being second-rate? Isn’t it better than nothing? No, ’tis being nowhere.”
And on being expostulated with, he wrote again: “It isn’t the praise I care
for (though of course I should like it as well as Milton did, I suppose),—I
mean the praise of others,—but what I miss is a comfortable feeling of
merit in myself. I have never even opened my new book since it was
published—I haven’t dared.”
It would be idle to seek too narrowly for the causes of this despondency.
As we have had frequent occasion to note, Lowell all his life was subject to
fluctuation of moods. The most comprehensive cause was no doubt in the
very constitution of his temperament, and as he was overclouded at times,
so for him the sun when it shone was more brilliant than to many. But one
asks most anxiously, are such moods superficial or do they trench upon the
very citadel of being, sapping and mining the walls, so that if entrance is
made, the very heart stops beating. In all the shifting of Lowell’s mind there
were great fundamental beliefs from which he would not be separated. It
may be that in those deepest laid foundations of being, where the bed-rock
of faith in spiritual realities is discovered to be a ledge of the rock of ages,
Lowell finally, as we have seen, confessed to an ultimate expression of
faith, which was that of a child in the dark; but how was it as regards that
firm belief in his country which had been a passion with him all his days,
and was in truth an elemental faith with him? It is hard to read his last
political discourse, “The Place of the Independent in Politics,” without a
little sense of pain mingled with one’s admiration for the serenity of the
temper with which Lowell made what was in effect a confession of his
political faith; for when one comes to rest his hopes for his country in the
remnant, he confesses almost to as much doubt as confidence. It must of
course be remembered that Lowell had given expression to his large faith in
democracy in his Birmingham address, and he calls the attention of his
audience to this as an explanation of the terms in which he is to address his
own countrymen. He might properly use a note of warning among a people
whose cardinal doctrine was the democratic principle, and he was justified
unquestionably in giving frankly his impressions of the low point to which
political organizations had fallen. Still, in undertaking to account for the
evolution of the democratic idea in American life, he was questioning
whether after all opportunity had not much to do with it, and whether now
that the walls were closing about this new country, the force of evolution
had not been largely spent. The dangers imminent in the constant inflow of
an ignorant body of foreigners, in the easy good-nature with which the
American tolerated abuses, and in the aristocratic character of a civil
service as diseased as the rotten borough of English politics,—these dangers
rose before him, threatening, alarming. He had lost faith largely in the
organic action of parties, chiefly because he saw in them the passive
instruments of unscrupulous politicians; and he found the correction of this
great evil in the increasing power of a neutral body. He even went so far as
to find the only hope of salvation in the action of the Independents. “If the
attempt should fail,” the attempt that is to reform the parties from without,
“the failure of the experiment of democracy would inevitably follow.”
This is not the place to discuss the merits of such a question. What I wish
is to show the working of Lowell’s mind on those political subjects which
had occupied him from boyhood. He was consistent throughout in holding
lightly to any allegiance to party, and in valuing highly the integrity of the
individual conscience, and his plea, gathering force as it proceeds, is for
such a spirit of devotion to the great ideals of the country as shall compel
the union of like-minded patriots in accomplishing the great active reforms
that press upon the minds of thoughtful men.
“What we want,” he says in conclusion, “is an active class who will
insist in season and out of season that we shall have a country ... whose
very name shall not only, as now it does, stir us as with the sound of a
trumpet, but shall call out all that is best within us by offering us the radiant
image of something better and nobler and more enduring than we, of
something that shall fulfil our own thwarted aspiration, when we are but a
handful of forgotten dust in the soil trodden by a race whom we shall have
helped to make more worthy of their inheritance than we ourselves had the
power, I might almost say the means, to be.”
No, Lowell’s last word to his countrymen in domestic politics was not
one of despair, however it may have been tinged with a sense of temporary
defeat. It was because of his strong love that he was jealous of the honor of
his country. The sadness is that of one weary in the fight, but the last note,
as in the other instances of his valedictories, was a call to action and the
reassertion of his undying faith in his country. Yet, as in the other instances,
there is the pathetic note of faith in spite of the evidence of sight.
Once again, a little later than this, he was called on to preside at a dinner
of the Civil Service Reform Association, and something of what he then
said may be quoted as showing how hope and courage came to the front
with him when great national issues were in question. “If I am sometimes
inclined to fancy,” he then said, “as old men will, that the world I see about
me is not so pleasant as that on which my eyes first opened, yet I am bound
to admit on cross-examining myself, that it is on the whole a better world,
better especially in the wider distribution of the civilized and civilizing
elements which compose it, better for the increased demands made upon it
by those who were once dumb and helpless and for their increasing power
to enforce those demands. But every advance in the right direction which I
have witnessed has seemed painfully slow. And painfully slow it was, if
measured, as we are apt to measure, by the standard of our own little lives,
and not, as we should, by that larger life of the community which can afford
to wait.
“Every reform like that in which we are interested has to contend with
vested interests, and of all vested interests abuses are those which are most
adroit in putting a specious gloss on their monopolies and most
unscrupulous as to the weapons to be used in their defence. The evil system
which we would fain replace with a better has gone on so long that it almost
seems part of the order of nature. It is a barbarous and dangerous system.
When I was in Spain I saw reason to think that the decay of that noble
nation, due, no doubt, to many causes, was due above all to a Civil Service
like our own that had gone farther on the inevitable road which ours is
going.
“It should seem that a reform like ours, so reasonable, so convenient, so
economical, would at once commend itself to the good sense of the people.
And I think there are manifest signs that it is more and more so
commending itself. The humanity of our day is willing (as our ancestors
were not) that the state should support its inefficient members. But did
humorist ever conceive a more wasteful way of supporting them than by
paying them salaries for performing ill the minor and more mechanical
functions of government, thus making this inefficiency costly to every one
of us in his daily affairs? Even supposing them capable of becoming
efficient, the chances are that, just when they have learned their business,
they will be dismissed to make room for other apprentices to pass through
the same routine. My own experience has convinced me that not only our
social credit, but our business interests have suffered greatly by the theory
still more or less prevalent that a man good for nothing else was just the
thing for one of the smaller foreign consulates.”
CHAPTER XVII
1888-1891
Lowell sailed for England 18 May, 1889, and spent five months there at
his customary haunts in London and in Whitby, revisiting his old friends
and preferring the intimate associations to the social functions. “You ask me
so many things,” he writes to Mrs. Clifford from Radnor Place, 17 June, “in
such a breathless way—all of them disparate, and some of them desperate
—that I know not which way to turn. Besides, haven’t you confessed that
you set springes in your notes? And how can I tell but that every? is a
springe (they look like it), and that I may not find myself dangling like an
unwary hare with no chance ever to put my foot into anything again?
However, I will tread cautiously and give each of ’em a little preliminary
shake to see if there be any mischief in ’em.
“1st. Will I come to tea Thursday? I turn it over gingerly—it lies quite
still and doesn’t seem likely to go off with a jerk. I think it harmless and
answer ‘yes.’ I don’t like the artist being there with her pictures, for that
may incur me the expense of several fibs, and I am not sure how many I
have left.
“2d. Do I know Miss——? This looks more suspicious and I give it a
wide berth.
Welcome to our website – the perfect destination for book lovers and
knowledge seekers. We believe that every book holds a new world,
offering opportunities for learning, discovery, and personal growth.
That’s why we are dedicated to bringing you a diverse collection of
books, ranging from classic literature and specialized publications to
self-development guides and children's books.
ebookbell.com