Data Structures and Other Objects Using C++ 2nd edition by Michael Main ISBN 8129705826 978-8129705822 - The full ebook version is just one click away
Data Structures and Other Objects Using C++ 2nd edition by Michael Main ISBN 8129705826 978-8129705822 - The full ebook version is just one click away
_____ Follow the link below to get your download now _____
https://ebookball.com/product/data-structures-and-other-
objects-using-c-2nd-edition-by-michael-main-
isbn-8129705826-978-8129705822-16344/
https://ebookball.com/product/data-structures-and-other-objects-
using-c-4th-edition-by-michael-main-walter-
savitch-0132129485-9780132129480-17178/
https://ebookball.com/product/data-structures-using-c-2nd-edition-by-
malik-0324782012-978-0324782011-17222/
https://ebookball.com/product/data-structures-and-problem-solving-
using-c-2nd-edition-by-malik-isbn-0324782012-978-0324782011-16350/
https://ebookball.com/product/principles-of-data-structures-using-c-
and-c-1st-edition-by-vinu-das-isbn-8122418589-9788122418583-15766/
https://ebookball.com/product/problem-solving-in-data-structures-and-
algorithms-using-c-1st-edition-by-hemant-jain-
isbn-9352655915-9789352655915-15768/
https://ebookball.com/product/problem-solving-in-data-structures-and-
algorithms-using-c-1st-edition-by-hemant-jain-
isbn-1540407306-9781540407306-15866/
DATA
STRUCTURES
&
OTHER
OBJECTS
Using C++ 4TH
EDITION
MICHAEL MAIN
Department of Computer Science
University of Colorado at Boulder
WALTER SAVITCH
Department of Computer Science
and Engineering
University of California, San Diego
Addison-Wesley
Boston Columbus Indianapolis New York San Francisco Upper Saddle River
Amsterdam Cape Town Dubai London Madrid Milan Munich Paris Montreal Toronto
Delhi Mexico City Sao Paulo Sydney Hong Kong Seoul Singapore Taipei Tokyo
ii Preface
Editor-in-Chief: Michael Hirsch Marketing Manager: Erin Davis
Editorial Assistant: Stephanie Sellinger Marketing Coordinator: Kathryn Ferranti
Managing Editor: Jeffrey Holcomb Art Director: Linda Knowles
Production Project Manager: Heather McNally Cover Designer: Elena Sidorova
Copy Editor: Sada Preisch Cover Artwork: © 2010 Stocksearch / Alamy
Proofreader: Genevieve d’Entremont Senior Manufacturing Buyer: Carol Melville
Access the latest information about all Pearson Addison-Wesley Computer Science titles from our World
Wide Web site: http://www.pearsonhighered.com/cs
The programs and applications presented in this book have been included for their instructional value. They
have been tested with care, but are not guaranteed for any particular purpose. The publisher does not offer any
warranties or representations, nor does it accept any liabilities with respect to the programs or applications.
Credits and acknowledgments borrowed from other sources and reproduced, with permission, in this textbook
appear on appropriate page within text.
UNIX® is a registered trademark in the United States and other countries, licensed exclusively through X-Open
Company, Ltd. Pez® is a registered trademark of Pez Candy, Inc.
Copyright © 2011, 2005, 2001, 1997 Pearson Education, Inc., publishing as Addison-Wesley, 501 Boylston
Street, Suite 900, Boston MA 02116. All rights reserved. Manufactured in the United States of America. This
publication is protected by Copyright, and permission should be obtained from the publisher prior to any
prohibited reproduction, storage in a retrieval system, or transmission in any form or by any means, electronic,
mechanical, photocopying, recording, or likewise. To obtain permission(s) to use material from this work,
please submit a written request to Pearson Education, Inc., Permissions Department, , 501 Boylston Street,
Suite 900, Boston MA 02116.
Many of the designations by manufacturers and seller to distinguish their products are claimed as trademarks.
Where those designations appear in this book, and the publisher was aware of a trademark claim, the
designations have been printed in initial caps or all caps.
QA76.73.C153M25 2010
005.13’3—dc22
2009049328
CIP
1 2 3 4 5 6 7 8 9 10--CRS--14 13 12 11 10
Preface
menting these (or similar) classes. With this in mind, the primary changes that
you’ll find for this edition are:
• A new Section 2.6 that gives an early introduction to the Standard Tem-
plate Library using the pair class. We have been able to introduce students
to the STL here even before they have a full understanding of templates.
• An earlier introduction of the multiset class and STL iterators in Section
3.4. This is a good location for the material because the students have just
seen how to implement their first collection class (the bag), which is
based on the multiset.
• We continue to introduce the STL string class in Section 4.5, where it’s
appropriate for the students to implement their own string class with a
dynamic array.
• A new Section 5.6 that compares three similar STL classes: the vector, the
list, and the deque. At this point, the students have enough knowledge to
understand typical vector and list implementations.
• A first introduction to the STL algorithms appears in Section 6.3, and this
is now expanded on in Sections 11.2 (the heap algorithms) and 13.4
(expanded coverage of sorting and binary search in the STL).
• A new Section 8.4 provides typical implementation details for the STL
deque class using an interesting combination of dynamic arrays and point-
ers.
• A discussion of hash tables in the proposed TR1 expansions for the STL
is now given in Section 12.6.
Most chapters also include new programming projects, and you may also keep
an eye on our project web site, www.cs.colorado.edu/~main/dsoc.html, for new
projects as we develop them.
Step 1: Understand the data type abstractly. At this level, a student gains an
understanding of the data type and its operations at the level of concepts and
pictures. For example, a student can visualize a stack and its operations of push-
ing and popping elements. Simple applications are understood and can be car-
ried out by hand, such as using a stack to reverse the order of letters in a word.
Step 2: Write a specification of the data type as a C++ class. In this step,
the student sees and learns how to write a specification for a C++ class that can
Preface v
implement the data type. The specification includes prototypes for the construc-
tors, public member functions, and sometimes other public features (such as an
underlying constant that determines the maximum size of a stack). The prototype
of each member function is presented along with a precondition/postcondition
contract that completely specifies the behavior of the function. At this level, it’s
important for the students to realize that the specification is not tied to any par-
ticular choice of implementation techniques. In fact, this same specification may
be used several times for several different implementations of the same data type.
Step 3: Use the data type. With the specification in place, students can write
small applications or demonstration programs to show the data type in use.
These applications are based solely on the data type’s specification, as we still
have not tied down the implementation.
understood. With this in mind, some instructors may wish to cover Chapter 14
earlier, just before stacks and queues.
Another alternative is to identify students who already know the basics of
classes. These students can carry out an inheritance project (such as the ecosys-
tem of Section 14.2 or the game engine in Section 14.3) while the rest of the stu-
dents first learn about classes.
Iterators. Iterators are another important part of the proposed Standard Tem-
plate Library, allowing a programmer to easily step through the items in a con-
tainer object (such as the elements of a set or bag). Such iterators may be
internal (implemented with member functions of the container class) or external
(implemented by a separate class that is a friend of the container class). We
introduce internal iterators with one of the first container classes (a sequential
list in Section 3.2). An internal iterator is added to the bag class when it is
needed in Chapter 6. At that point, the more complex external iterators also are
discussed, and students should be aware of the advantages of an external itera-
tor. Throughout the text, iterators provide a good opportunity for programming
projects, such as implementing an external bag iterator (Chapter 6) or using a
stack to implement an internal iterator of a binary search tree (Chapter 10).
In a course that has time for advanced tree projects (Chapter 11), we analyze
the recursive tree algorithms, explaining the importance of keeping the trees
balanced—both to improve worst-case performance, and to avoid potential run-
time stack overflow.
Advanced Projects
The text offers good opportunities for optional projects that can be undertaken
by a more advanced class or by students with a stronger background in a large
class. Particular advanced projects include the following:
• A polynomial class using dynamic memory (Section 4.6).
• An introduction to Standard Library iterators, culminating in an imple-
mentation of an iterator for the student’s bag class (Sections 6.3 through
6.5).
• An iterator for the binary search tree (Programming Projects in Chapter
10).
• A priority queue, implemented with a linked list (Chapter 8 projects), or
implemented using a heap (Section 11.1).
• A set class, implemented with B-trees (Section 11.3). We have made a
particular effort on this project to provide information that is sufficient for
students to implement the class without need of another text. In our
courses, we have successfully directed advanced students to do this
project as independent work.
• An inheritance project, such as the ecosystem of Section 14.2.
• An inheritance project using an abstract base class such as the game base
class in Section 14.3 (which allows easy implementation of two-player
games such as Othello or Connect Four).
• A graph class and associated graph algorithms from Chapter 15. This is
another case where advanced students may do work on their own.
Preface ix
Typical course. Start with Chapters 1–10, skipping parts of Chapter 2 if the
students have a prior background in C++ classes. Most chapters can be covered
in a week, but you may want more time for Chapter 5 (linked lists), Chapter 6
(templates), Chapter 9 (recursion), or Chapter 10 (trees). Typically, we cover the
material in 13 weeks, including time for exams and extra time for linked lists
and trees. Remaining weeks can be spent on a tree project from Chapter 11, or
on binary search (Section 12.1) and sorting (Chapter 13).
extra weeks at the end of the term, so that students may spend more time on
searching, sorting, and the advanced topics (shaded on page xi.)
We also have taught the course with further acceleration by spending no lec-
ture time on stacks and queues (but assigning those chapters as reading).
Early recursion / early sorting. One to three weeks may be spent at the start
of class on recursive thinking. The first reading will then be Chapters 1 and 9,
perhaps supplemented by additional recursive projects.
If recursion is covered early, you may also proceed to cover binary search
(Section 12.1) and most of the sorting algorithms (Chapter 13) before introduc-
ing C++ classes.
Chapter Dependencies
At the start of the course, students should be comfortable writing functions and using
arrays in C++ or C. Those who have used only C should read Appendix F and pay
particular attention to the discussion of reference parameters in Section 2.4.
Chapter 1
Introduction
Section 14.3
Virtual Methods Section 11.4
Detailed Tree Analysis
The shaded boxes provide
good opportunities for
advanced work.
xii Preface
Acknowledgments
We started this book while Walter was visiting Michael at the Computer Science
Department of the University of Colorado in Boulder. The work was completed
after Walter moved back to the Department of Engineering and Computer Sci-
ence at the University of California, San Diego. We are grateful to these institu-
tions for providing facilities, wonderful students, and interaction with congenial
colleagues.
Our students have been particularly helpful—nearly 5000 of our students
worked through the material, making suggestions, showing us how they learned.
We thank the reviewers and instructors who used the material in their data struc-
tures courses and provided feedback: Zachary Bergen, Cathy Bishop, Martin
Burtscher, Gina Cherry, Courtney Comstock, Stephen Davies, Robert Frohardt,
John Gillett, Mike Hendricks, Ralph Hollingsworth, Yingdan Huang, Patrick
Lynn, Ron McCarty, Shivakant Mishra, Evi Nemeth, Rick Osborne, Rachelle
Reese, and Nicholas Tran. The book was also extensively reviewed by Wolfgang
W. Bein, Bill Hankley, Michael Milligan, Paul Nagin, Jeff Parker, Andrew L.
Wright, John R. Rose, and Evan Zweifel. We thank these colleagues for their
excellent critique and their encouragement.
Thank you to Lesley McDowell and Chris Schenk, who are pleasant and
enthusiastic every day in the computer science department at the University of
Colorado. Our thanks also go to the editors and staff at Addison-Wesley. Heather
McNally’s work has encouraged us and provided us with smooth interaction on
a daily basis and eased every step of the production. Karin Dejamaer and Jessica
Hector provided friendly encouragement in Boulder, and we offer our thanks to
them. We welcome and appreciate Michael Hirsch in the role of editor, where he
has shown amazing energy, enthusiasm, and encouragement. Finally, our origi-
nal editor, Susan Hartman, has provided continual support, encouragement, and
direction—the book wouldn’t be here without you!
In addition to the work and support from those who put the book together, we
thank those who offered us daily interest and encouragement. Our deepest thanks
go to Holly Arnold, Vanessa Crittenden, Meredith Boyles, Suzanne Church, Erika
Civils, Lynne Conklin, Andrzej Ehrenfeucht, Paul Eisenbrey, Skip Ellis, John
Kennedy, Rick Lowell, George Main, Mickey Main, Jesse Nuzzi, Ben Powell,
Marga Powell, Megan Powell, Grzegorz Rozenberg, Hannah, Timothy, and
Janet.
Contents
2.2 Constructors 45
The Throttle’s Constructor 46
What Happens If You Write a Class with No Constructors? 49
Programming Tip: Always Provide Constructors 49
Revising the Throttle’s Member Functions 49
Inline Member Functions 49
Programming Tip: When to Use an Inline Member Function 50
Self-Test Exercises for Section 2.2 51
2.3 Using a Namespace, Header File, and Implementation File 51
Creating a Namespace 51
The Header File 52
Describing the Value Semantics of a Class Within the Header File 56
Programming Tip: Document the Value Semantics 57
The Implementation File 57
Using the Items in a Namespace 59
Pitfall: Never Put a Using Statement Actually in a Header File 60
Self-Test Exercises for Section 2.3 62
2.4 Classes and Parameters 63
Programming Example: The Point Class 63
Default Arguments 65
Programming Tip: A Default Constructor Can Be Provided by Using Default
Arguments 66
Parameters 67
Pitfall: Using a Wrong Argument Type for a Reference Parameter 70
Clarifying the Const Keyword
Part 3: Const Reference Parameters 72
Programming Tip: Use const Consistently 73
When the Type of a Function’s Return Value Is a Class 73
Self-Test Exercises for Section 2.4 74
2.5 Operator Overloading 74
Overloading Binary Comparison Operators 75
Overloading Binary Arithmetic Operators 76
Overloading Output and Input Operators 77
Friend Functions 80
Programming Tip: When to Use a Friend Function 81
The Point Class—Putting Things Together 82
Summary of Operator Overloading 85
Self-Test Exercises for Section 2.5 85
2.6 The Standard Template Libary and the Pair Class 86
Chapter Summary 87
Solutions to Self-Test Exercises 88
Programming Projects 90
Contents xvii
Our progress was slow. For some while we carried strong winds,
which swept us onwards into the softer climates of the Pacific; they
then failed us, and were followed by a succession of light airs, as
often ahead as astern. I was astonished, however, by the yacht-like
qualities of motion of the little barque. Through weather that had
scarcely weight enough in it to have stirred the Countess Ida, the
Lady Blanche would sneak over a surface of water that was often
glass-like, ripples fine as wire breaking away from her keen stem,
and a short wake scoring the liquid smoothness under her counter;
her topsails and courses motionless, save but for their soft swaying
to the long and gentle respiration of the swell; a faint lifting,
however, perceptible in the light cloths of the loftier sails, which
were doing the work of the rest, and communicating to the little
fabric out of the delicate softness of the blue Pacific heavens, so to
speak, an impulse of vitality, the recollection of which would move
me to amazement when I found that our progress in the twenty-four
hours had been as considerable as the Indiaman would have got out
of a pleasant breeze.
But not to linger upon this time—though I could tell much of my
incessant intimate association with Miss Temple—dwell with delight,
untinctured by recollection of the miseries and anxieties of this
passage, upon the memory of the soft and lovely nights of those
delicious parallels, the clear dusk radiant with the glistening of stars
from sea-line to sea-line, the mild atmosphere, sweet with dew, the
hush upon the slumbering leagues of the deep, soothing as a
benediction to the perturbed spirit, the play of delicate fires in the
water, the stirring of canvas in the still gloom aloft, as of the
brushing of the pinions of hovering creatures: then the wide blue
sparkling scene of day, the barque clothed in the ivory whiteness of
her canvas striking a prismatic shadow of pearl from her white sides
and silken heights into the opalescent profound, on which she would
rest as on a bed of glass, some distant fountain and curve of wet
black body denoting the rising of a leviathan from the depths—ah!
had all been well with us, this would have made a noble time for the
memory to muse on—but my story draws me to its conclusion.
It was February the 18th, as very well indeed do I remember.
From the hour of our having sighted the whaler off Cape Horn, we
had met with nothing, not even of the bigness of the tip of the wing
of a sea-fowl, to break the continuity of the sea-line, no shadow of
low-lying land, no vision of star-like space of water indicating the
froth of the submerged reef. On this day at noon, having worked out
my calculations, I discovered that the distance to Braine’s island, as I
may call it, from the then situation of the barque, was to be
traversed, if the light air held as it was, in about twelve hours; so
that it would be proper to keep a lookout for it at about midnight.
I gave Mr. Lush this piece of news; he received it with a flush of
excitement that almost humanised the insipid coarseness of his dull,
wooden, leather-bound, weather-hardened visage.
‘Ye may calculate upon our keeping a bright lookout, sir,’ said he
with a grin that disclosed his tobacco-coloured fangs, and that might
fairly be called sardonic, since the eyes bore no part in this
disagreeable expression of satisfaction.
I watched him walk forwards to convey the information to the
men. They went in a whole body on to the forecastle, and stood
staring about them, as though the ocean wore a new countenance
to their gaze, now that they believed Braine’s island to be a short
distance past the slope of it. The carpenter pointed, and was full of
talk; there was much lighting of pipes, expectoration, puffing of
great clouds indicative of emotion, uneasy, impatient, flitting
movements amongst the men, some of whom presently broke up
into couples and fell to pacing the forecastle like marines on sentry;
talking, as I did not doubt, of the money they were going to dig up,
what they would do with it when they had it, and so on; the
expressions on their faces varying at every instant, one emotion
suppressing another in a manner that to a contemplative and
leisurely eye would have provided a study at once ludicrous and
informing.
I had the watch that afternoon; and when Miss Temple and I had
eaten our little midday meal, I drew chairs into the shadow of the
short awning, and we sat together, I, pipe in mouth, occasionally
quitting her side to take a look outside the edge of our canvas roof,
along with a brief stare ahead, for I could not be sure of Captain
Braine’s chronometer, nor of the exactness of my own calculations,
and if the madman’s island was where he had declared it to be, it
might heave into view off either bow or right ahead at any moment,
for all I could tell.
Miss Temple stood in no need now of Captain Braine’s overcoat.
She was habited in the costume of the Countess Ida; somewhat
soiled it was, yet the perfect fit of it continued to atone for its
shipwrecked airs. Her dark eyes glowed under the shadow of the
straw hat she had had on when she left the Indiaman. She needed
but her jewelry, the flash and decoration of her trinkets, to show
very nearly as finely as she had on that day. There was but little
alteration visible in her. For my part I could detect no more than that
her face was a trifle thinner than when we had first entered on this
wild adventure. The eye of close and constant association would not
indeed witness changes which might instantly be perceptible to one
encountered after an absence. Still, I had the image of her brilliant
on my mind as she was on board the Indiaman, and viewing her
now, as I say, I could perceive no other change than what I have
mentioned. Intellectually, however, there was an alteration, defined
to a degree to my sight. Her gaze was softened, and was often
sweet. The characteristic firmness of her lips had lost its air of
haughtiness. There was no longer any manner of command in her
looks, nor of exaction in her fixed regard; there was nothing to hint
that her spirit was broken—merely that it had been bowed to an
average human level by the rough usage of the sea, and by the
amazing experiences with which her months of lonely association
with me had been surcharged.
Heretofore, that is to say for some weeks past, she had exhibited
a resigned, calm, resolved behaviour, as of one who was constantly
schooling herself to prepare for an issue of life or death. She had
long ceased to utter a complaint; she would even detect a sigh in
herself with a glance of contrition and self-reproach. Again and again
had I complimented her upon the heroic qualities which her
sufferings of mind and body had fructified in her; but this afternoon
she was feverishly impatient and restless. The old fires of her spirit
when alarmed were in her eyes. I would observe her struggling in
vain to appear composed. As we sat together, she exclaimed, as she
brought her eyes to my face from a nervous sweeping gaze at the
horizon over the bows: ‘By this time to-morrow we shall know our
fate.’
‘Perhaps not. Yet I pray it may be so. If I were sentenced to be
hanged, I would wish the hour come. But what is to be our fate?
Nothing in this life is so bad or so good as our fears or our hopes
would have us think. If there should be no island—— Well, those
villains will find me on the alert for what may come along in the
shape of chance, and you must be ready.’
‘I am ready,’ she exclaimed; ‘only tell me what to do. But this
expectation——’ Her lips trembled, and her white fingers clenched to
the agitation that possessed her. ‘The misery is, Mr. Dugdale, you
have no scheme.’
‘That will come,’ I exclaimed; ‘be calm, and remain hopeful. I
might, in the language of the heroes of novels, hope to reassure you
by promising that if we are to perish we will perish together. I am
not a hero, and I talk with the desire and the intention of living.
There may be a few more adventures yet before us; but your hand
is in mine, and I shall not relinquish it until I conduct you to your
mother’s side.’
Of course I talked only to cheer her; yet I hoped even as I spoke,
and my hope gave a tone of conviction to my words that seemed to
animate her, and she smiled whilst her wistful eyes sank, as though
to a sudden reverie.
During the rest of the day the crew were ceaselessly on the move,
passing in and out of the galley and in and out of the forecastle,
pacing the planks with impatience strong in their rolling gait; one or
another of them from time to time springing on to the head rail to
peer thirstily and steadfastly under the shelter of his hand; one or
another again at long intervals ascending to the height of the
foreroyal yard, there to linger, whilst the fellows below gazed up with
expectant faces, and ears greedy for a cry from that lofty summit.
The sturdy figure of the carpenter was conspicuous amongst them.
When he came aft, he would look as though willing to converse with
me, but I walked away abruptly on his approach, and if I chanced to
leave the cabin when he was on deck, I kept to the lee side,
contriving an air that even to his unintelligent gaze must have
conveyed the assurance that I wished to have nothing to do with
him.
The breeze was light, just forward enough on the beam to allow of
the foretopmast studding-sail remaining abroad. So weak was the
air, that the barque crept along with erect spars, and the red fly of
the dogvane scarcely flickered to the soft breathings at the royal
mast head. I feared that it would fall a dead calm at sun-down, but
greatly to my satisfaction, there was a small freshening in the breeze
whilst the scarlet yet lay gloriously upon the cloudless countenance
of the west. Indeed, my own almost crazy anxieties and expectation
made the mere fancy of a spell of stagnation abhorrent to me.
Supposing the chronometer below to be correct, I was in little doubt
of the accuracy of my computations, and my desire to verify or
disprove the madman’s assurance was consuming and insupportable.
When the night descended it was moonless, and through the
pleasant blowing of the wind, of a singular sweetness and freshness
such as I could not imagine of darkness in any other ocean. The
water was now streaming in a line of whiteness along either side,
and the murmur under the counter was as constant as the voice of a
running brook heard amid the stillness of a summer night. The
carpenter had the watch from eight to twelve; but for my part I
could not find it in me to go to my cabin. Such was my feverishly
restless condition, that I knew I should close my eyes in vain, and
that the inactivity of a recumbent posture would speedily grow
irksome and intolerable. Miss Temple entreated me to lie down upon
the locker in the cabin. I answered that I should be unable to sleep,
and that without sleep the mere resting of my limbs would be of no
service to me.
‘But you will have to watch from twelve to four,’ she exclaimed,
‘and at this rate you will get no sleep to-night.’
I smiled, and answered that Braine and the carpenter between
them had murdered sleep; and then took her on deck, where we
walked and conversed till the hour of eleven—six bells. I then
returned with her to the cabin. She declined to enter her berth; she
begged me, and her eyes pleaded with her voice, to suffer her to
remain at my side throughout the night. But this I would not hear
of; I told her that such a vigil would exhaust her, that her utmost
strength might have to be taxed sooner than either of us could
imagine; that she must endeavour to obtain some repose upon the
locker, and that if anything resembling land showed during my
watch, I would call her. I saw a look of reproachful remonstrance in
her face; but compliance was now a habit with her, and in silence
she allowed me to arrange a pillow and to throw a light blanket, that
I fetched from her bed, over her feet. I sat near her at the table,
leaning my cheek on my elbow, and from time to time exchanged a
few words with her. There was hardly any movement in the sea. The
wind held the canvas motionless. The seething alongside was too
delicate to penetrate, and the silence in the little cuddy was
unbroken save by the ticking of a small brass clock under the
skylight, and by the measured tramp of the carpenter overhead.
A little before twelve I looked at my companion, and perceived
that she was asleep. On the eve, as I believed we were, of God
alone knew what sort of events, the spectacle of the slumbering
unconscious girl, whose beauty was never so affecting as when
softened, and I may say spiritualised by the expression of placid
repose, moved me to the heart. What a strange association had
been ours! How intimate had we become! what confidences had our
common suffering caused us to exchange! what condition of
shoregoing life was there that could have brought this girl and me
together as we had been and still were? How I loved her, I was now
knowing; I could dwell upon my passion with delight as I looked at
her, though on the threshold of a future that might prove terrible
and destructive to us both. What was the secret of her heart, so far
as I was concerned? I gazed at her lips with some unintelligible hope
of witnessing them shape the syllables of my name; then the clear
chimes of eight bells floated aft. With a sigh and a prayer, I dimmed
the cabin lamp and went softly to the companion steps.
On my emerging, the carpenter came up to me.
‘It’s been blowing a steady air o’ wind,’ said he; ‘allowing for this
here improvement in our pace, what time d’ye reckon the island’ll
take to show itself?’
‘If it exists,’ I answered, ‘it might be in sight now. The captain’s
description showed that there was no height of side to make a loom
of. If you’re going forward, see that a couple of hands are stationed
on the forecastle, and tell them to keep a bright lookout. We don’t
want to run the reef down, if it’s there.’
‘Ay, ay, sir,’ he exclaimed in the rough off-hand voice of a sailor
receiving an order, and left the poop.
The time crept away. There was a light burning in the galley; and
the shapes that flitted in and out through the open door, throwing
giant shadows upon the hazy square of illumination on the bulwark
abreast of the galley entrance, satisfied me that most if not all of the
men were awake and on the lookout. Several figures, never less
than two, paced against the stars over the bows with the regular
tread of sentinels, clear on the forecastle under the forecourse by
the spaces of the spangled sky they blotted out as they moved. The
breeze continued a pleasant air, and all about the gliding barque
were the summer tinkling sounds of water gently broken.
Occasionally, I would go forward, and taking my stand on the rise of
the cathead where it sloped to the rail, strain my eyes into the
elusive starry dusk where sea and sky seemed to melt into liquid
gloom. No one accosted me as I passed to and fro. Once I heard the
tones of the carpenter in the galley warm in argument. The fellows
pacing the forecastle would come to a halt whenever I went
forward, and stand looking at me in silence, full of expectation, no
doubt, of my being able to see more than they. The very barque
herself seemed to participate in the emotions, the breathless
curiosity, the avid yearnings of the men who awaited the appearance
of the island with restless motions and voices subdued into low
growling notes: the ship herself, I say, seemed governed by the
impassioned expectation of the hour, so tremulously breathless was
she aloft, so still and subtle was her movement through the water,
so hearkening the aspect of her forward, as though the stirless curve
of her jibs were ears which she eagerly projected that she might
catch the first sound of the wash of surf.
All this while Miss Temple lay soundly sleeping below.
It was wanting about ten minutes to four when the quarter-deck
was suddenly hailed from the forecastle. The voice rang loud and
startlingly upon the ear used to the continued stillness of the night.
‘Hallo!’ I cried.
‘There’s something dark right ahead,’ came back the answer.
I whipped the glass out of the companion, and walked swiftly
forwards where all the crew had run to the first cry, and where I
found them standing in a huddle of shadowy shapes at the rail,
some pointing, and all looking in one direction.
‘Where away is the object reported?’ I exclaimed.
‘Yonder,’ cried the carpenter, stepping out of the little crowd and
projecting his arm almost on a line with the jib-boom end.
I instantly perceived it! It was just a streak of shadow, low-lying,
like a line of cloud beheld by night lifting a few fathoms of its brow
above the sea-line. I pointed the telescope; and the lenses without
revealing features, resolved the length of airy obscurity into the firm
proportions of land.
‘Is it the island, sir?’ demanded the carpenter in a voice hoarse
with excitement.
My own astonishment—the wonder raised in me by yonder prompt
settlement of the incredulity that had possessed me from the first
minute of hearing the captain’s story—the conflict of emotions which
followed on my considering that the land ahead must inevitably be
Braine’s island, since the chart showed clear water to the distance of
the latitude of Easter Island, which the low stretch over the bows
most assuredly was not, the loom being little more than that of a
reef—rendered my ear deaf to the carpenter’s inquiry. He repeated
his question.
‘If not, then I know not what other land it can be,’ said I. ‘How far
distant will it be, think you?’
The men gathered about us to hear what was said.
‘Three mile about,’ he answered.
‘More like five,’ grumbled out a seaman.
‘Five in your eye!’ cried another—‘more like tew. If ye’ll stay your
breathing, you’ll hear the wash o’ the surf.’
‘Better shorten sail and wait for daylight, Mr. Lush,’ said I.
‘Ay, ay, sir,’ he answered; ‘that’ll be the proper thing to do;’ and
instantly fell to bellowing out orders.
The uproar of the excited crew clewing up and hauling down,
yelling as they pulled at the ropes, and springing about with an
alacrity that made their darting figures resemble those of madmen,
awakened Miss Temple. I stood alone on the poop, endeavouring to
obtain a view of the land by leaning over the rail, when she came up
to me.
‘What is it, Mr. Dugdale?’
‘Land!’ I exclaimed, instantly turning to her.
‘The island?’ she cried, suppressing astonishment until she should
have received my answer.
‘I have no doubt of it. The shadow indicates that it is little more
than a reef. Its bearings, according to my computation, accurately
correspond with those given by Captain Braine.’
She projected her head over the rail, but was some time before
she could distinguish the mere dash of gloom that the land made
upon the horizon.
‘If it should be the island!’ she cried. ‘That you should have
steered this ship straight as an arrow for it, and that it should be
there—no madman’s dream, as we have both believed it! If one part
of the story be true, the other part should be so.’
I was too astounded to converse. I could do no more than
ejaculate. To be sure, as my companion had said, if the story of the
island was true, the story of the gold might be equally true. There
would be the treasure, then, for the men to possess themselves of!
And afterwards?
My brains seemed to whirl like a teetotum in my skull.
Meanwhile, the sailors had reduced sail till the barque was now
under topsails only, the rest of the canvas hanging from the yards in
the grip of its gear. The carpenter arrived on the poop.
‘Mr. Dugdale,’ he exclaimed, in a rough, congratulatory voice,
‘you’ve done wonderfully well, sir. By ——! but I don’t think there’s
e’er a navigator would have struck it true as a hair as ye have. Ye’ve
got no doubts now left, I allow?’ and I saw his face darken with the
wrinkles of the grin that overspread his countenance.
‘What’s to follow?’ I demanded, thinking to take advantage of his
mood.
‘Why, the gold,’ he answered, ‘the money, sir; what we’ve been a-
waiting for; and what I suspects we’ll most of us know what to do
with when we gits it.’
‘And then?’
‘That’ll be a matter for consideration,’ he answered, drawing off
and going to the rail and staring ahead.
‘Back the topsail yard and bring the ship to a stand, Mr. Lush,’ said
I, ‘and get a cast of the lead, will you?’
These orders were immediately obeyed. The lead ran out to the
whole scope of line without touching bottom. There was nothing
now to be done but to wait for daylight. A whole eternity seemed to
pass before the dawn broke. Then to the sifting of the dull gray
faintness over the rim of the eastern sea, the land came stealing
out, till, to the sudden soaring of the sun into the clear blue sky of
the Pacific morning, it flashed out into its full proportions and
distinctive features not a mile off our port beam as we then lay with
our maintopsail aback.
The crew, neglecting all discipline and shipboard habit, were
assembled in a body on the poop; and thus we all stood looking, I a
little distance away from them with Miss Temple at my side. It was a
small coral island, apparently of the dimensions that Captain Braine
had named. To the northward the smooth water brimmed to a long
shelf of coral grit, lustrous as snow in the sparkle of the early
sunshine. There was a small rise, green with vegetation, in the
centre of the island; how far distant, I could not imagine. Almost
abreast of us, the land went in with a semicircular sweep like to a
horseshoe, and was exactly the lagoon that had been described by
Captain Braine. In the centre of it, just as he had marked the thing
down upon his chart, rose a coral formation of the appearance of a
very thick pillar, and at the distance from which we surveyed it, it
might easily have passed for a monument of white stone erected by
human hands, the decorated summit of which had been rudely
broken off by a tempest or some volcanic shock. On a line with this
pillar, some little distance up the beach of the lagoon, were several
clumps of trees. There was a deal of a sort of stunted vegetation
going inland from the margin of the little bay, coarse grass, as my
telescope made out, tangles of bushes, and so on.
The carpenter in the midst of the men stood with the parchment
chart in his hand, pointing out how the outlines corresponded with
those of the land, amidst a hubbub of eager comments and
exclamations of excitement. For my part, I could not credit my
senses; I disputed the evidence of my own eyes; I brought them
away from the island to fix them with an emotion of profound
bewilderment upon Miss Temple.
‘Can it be real?’ I cried. ‘After the weeks of conviction of the utter
madness of this quest, am I at last to be persuaded that the
wretched suicide was not mad, that his island is a fact, and his gold
an absolute reality too?’
I turned my back upon the crew to press my hands to my eyes to
ease my brow of an intolerable sense of swooning in it.
‘Three cheers for him, men!’ I heard the carpenter roar out. Volley
after volley of huzzas rang from the deep sea lungs of the sailors.
They were cheering me. I turned to find them all looking my way.
They tossed their caps and flourished their arms like madmen in the
exuberance of their delight.
‘Now, sir,’ sung out the carpenter, ‘hadn’t we better see to our
ground tackle?’
‘As you will,’ I answered; ‘there is your island; I have kept my
word with you; now, Mr. Lush, the crew will proceed as they think
proper. When you require my services again as a navigator I am
ready;’ and so saying I seated myself on the edge of the skylight,
and with folded arms continued to view the island with such
astonishment and incredulity as made me fear for my head.
‘Is it all for the best, do you think, Mr. Dugdale?’ said Miss Temple,
who had seated herself beside me.
‘I cannot tell—it may be so. If they find the money, the wretches’
delight and good temper may render them willing to comply with my
wishes to make for the nearest port. I am in a dream. Give me a
little time to recover my amazement. You know it ought to be
impossible that that island should be there.’
She glanced at me anxiously, with something of alarm indeed, as
though there was even a greater strangeness in my manner than in
my language. Long hours of anxiety, long hours of sleeplessness, the
continual apprehension of what was to follow if this island was not
discoverable, these things and how much more had done their work
with me; and now on top was come the shock of the discovery of
the truth of what I had all along been convinced was the dream of a
madman—the lie of a crazy head! I felt a moisture in my eyes; my
limbs trembled; my breathing grew thick and difficult. In silence,
Miss Temple hurried below and returned with a tumbler of cold
brandy grog. She put it into my hand, and I drank it off; and I have
very little doubt that the strong stimulant—such a dose as might
have made me boozy in an hour of ease!—rescued me from an
attack of hysterics, man as I am who tell this!
Meanwhile the seamen had gone forward, and were all hard at
work with the chain cables, connecting them with the anchors,
affixing tackles, hoisting the ponderous irons to the catheads, and
filling the barque with business and songs. They worked with
desperate will and eagerness, yet their progress was slow, and the
sun had mounted many degrees before all was ready forward for
bringing up. They then went tumultuously to breakfast, which they
devoured upon deck, emptying their hook-pots down their throats,
and hastily eating their biscuit and meat, whilst they jabbered away
in voices of enthusiasm, one calling out a joke to another amidst
loud laughter.
The carpenter had now taken command. He came aft while Miss
Temple and I nibbled at some breakfast which Wilkins had brought
us on deck, and ordered the maintopsail to be swung, and stationed
a hand with a lead-line in each of the main-chains. The wind was
about south, and allowed the barque with her yards braced fore and
aft to very nearly look up for the lagoon. We crept slowly along; the
lead on either hand went in frequent flights towards the bow, but no
bottom was reported. This went on till the yawn of the lagoon was
upon our starboard quarter, with the trend of the land covered with
bushes opening out as it ran into the south-east, and then came a
shout from the port main chains. The water now shoaled rapidly; a
man stood forward ready to let go the anchor; down thundered the
topsail yards to the cry of the carpenter to let go the halliards; the
barque lost way; the sharp clank of a hammer rang through the
vessel, followed by a mighty splash, and the roar of iron links torn in
fury through the hawse-pipes.
In a few moments the Lady Blanche was at rest, with the western
spur of the lagoon within half a mile of 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.
ebookball.com