Download Learning functional data structures and algorithms learn functional data structures and algorithms for your applications and bring their benefits to your work now Khot ebook All Chapters PDF
Download Learning functional data structures and algorithms learn functional data structures and algorithms for your applications and bring their benefits to your work now Khot ebook All Chapters PDF
com
OR CLICK BUTTON
DOWNLOAD NOW
https://textbookfull.com/product/probabilistic-data-structures-and-
algorithms-for-big-data-applications-gakhov/
textboxfull.com
https://textbookfull.com/product/data-structures-and-algorithms-in-
swift-kevin-lau/
textboxfull.com
https://textbookfull.com/product/data-structures-algorithms-in-python-
john-canning/
textboxfull.com
Codeless Data Structures and Algorithms: Learn DSA Without
Writing a Single Line of Code Armstrong Subero
https://textbookfull.com/product/codeless-data-structures-and-
algorithms-learn-dsa-without-writing-a-single-line-of-code-armstrong-
subero/
textboxfull.com
https://textbookfull.com/product/algorithms-and-data-structures-in-
action-meap-v12-marcello-la-rocca/
textboxfull.com
https://textbookfull.com/product/a-common-sense-guide-to-data-
structures-and-algorithms-1st-edition-jay-wengrow/
textboxfull.com
https://textbookfull.com/product/data-structures-algorithms-in-go-1st-
edition-hemant-jain/
textboxfull.com
Learning Functional Data
Structures and Algorithms
Table of Contents
Learning Functional Data Structures and Algorithms
Credits
About the Authors
About the Reviewer
www.PacktPub.com
Why subscribe?
Customer Feedback
Preface
What this book covers
What you need for this book
Who this book is for
Conventions
Reader feedback
Customer support
Downloading the example code
Downloading the color images of this book
Errata
Piracy
Questions
1. Why Functional Programming?
The imperative way
Higher level of abstraction
Functional programming is declarative
No boilerplate
Higher order functions
Eschewing null checks
Controlling state changes
Recursion aids immutability
Copy-on-write
Laziness and deferred execution
Composing functions
Summary
2. Building Blocks
The Big O notation
Space/time trade-off
A word frequency counter
Matching string subsets
Referential transparency
Vectors versus lists
Updating an element
Not enough nodes
Complexities and collections
The sliding window
Maps
Persistent stacks
Persistent FIFO queues
Sets
Sorted set
Summary
3. Lists
First steps
List head and tail
Drop elements
Concatenating lists
Persistent data structures
Tail call optimization
List append
List prepend
Getting value at index
Modifying a list value
Summary
4. Binary Trees
Node definitions
Building the tree
Size and depth
Complete binary trees
Comparing trees
Flipping a binary tree
Binary tree traversal
The accumulator idiom
Binary Search Trees
Node insertion
Searching a key
Updating a value
Exercising it
Summary
5. More List Algorithms
Binary numbers
Addition
Multiplication
Greedy algorithms and backtracking
An example of a greedy algorithm
The backtracking jig
Summary
6. Graph Algorithms
Reversing a list
Graph algorithms
Graph traversal
Avoiding list appending
Topological sorting
Cycle detection
Printing the cycle
Summary
7. Random Access Lists
Incrementing a binary number
Adding two binary numbers
List of tree roots
Insertion
Lookup
Removal, head, and tail
Update
Summary
8. Queues
Understanding FIFO queues
Functional FIFO queues
Invariants
Implementing a priority queue
Understanding priority queues/heaps
Leftist trees
Functional heaps
Summary
9. Streams, Laziness, and Algorithms
Program evaluation
Eager evaluation
Argument evaluation
Lazy evaluation
Lazy evaluation in Scala
Lazy evaluation in Clojure
Memoization - remembering past results
Memoization in Scala
Memoization in Clojure
Memoizing simpleFactFun
Streams
Stream in Scala
Indexing the elements of a stream
Creation of an infinite length stream
Stream is immutable
Creating a stream from another
Stream to list
Appending one stream to another
Length of a stream
Some mathematical functions of the stream class
Some more methods of the stream class
Streams (lazy sequence) in Clojure
Creating a memoized function of lazy sequences in Clojure
Some algorithms on stream
Arithmetic progression
Arithmetic progression in Scala
Arithmetic progression in Clojure
Standard Brownian motion
Standard Brownian motion in Scala
Standard Brownian motion in Clojure
Fibonacci series
First form of Fibonacci series
Second form of Fibonacci series
Fibonacci series in Scala
Fibonacci series in Clojure
Summary
10. Being Lazy - Queues and Deques
Imperative implementations
Amortization
Problem with queues
Strict versus lazy
Streams
Streams meet queues
A sense of balance
Amortized deques
Summary
11. Red-Black Trees
Terminology
Almost balanced trees
The concept of rotation
Red-Black trees
Inserting a node
The Black-Red-Red path
Left, left - red child and grand child
Left child, right grand child
Right child, right grand child
Right, left
Verifying the transformation
Complexity
Summary
12. Binomial Heaps
Binomial trees
Left child, right sibling
A binomial heap
Linking up
Inserting a value
Binary number equivalence
Merging
Find the minimum
Deleting the minimum
Exercising the code
Complexity
Summary
13. Sorting
Stable and unstable sorting
Stable sorting
Unstable sorting
Bubble sort
Scala implementation of bubble sort
Complexity of bubble sort
Selection sort
Complexity of selection sort
Insertion sort
Complexity of insertion sort
Merge sort
Splitting the sequence
Merging two sorted subsequences
Complexity of merge sort
Quick sort
Partition
Complexity of quick sort
Summary
Learning Functional Data
Structures and Algorithms
Learning Functional Data
Structures and Algorithms
Copyright © 2017 Packt Publishing
Every effort has been made in the preparation of this book to ensure the
accuracy of the information presented. However, the information
contained in this book is sold without warranty, either express or
implied. Neither the authors, nor Packt Publishing, and its dealers and
distributors will be held liable for any damages caused or alleged to be
caused directly or indirectly by this book.
Livery Place
35 Livery Street
ISBN 978-1-78588-873-1
www.packtpub.com
Credits
Authors
Copy Editor
Atul S. Khot
Gladson Monteiro
Raju Kumar Mishra
Raju Kumar Mishra is a consultant and corporate trainer for big data
and programming. After completing his B.Tech from Indian Institute of
Technology (ISM) Dhanbad, he worked for Tata Steel. His deep passion
for mathematics, data science, and programming took him to Indian
Institute of Science (IISc). After graduating from IISc in computational
science, he worked for Oracle as a performance engineer and software
developer. He is an Oracle-certified associate for Java 7. He is a
Hortonworks-certified Apache Hadoop Java developer, and holds a
Developer Certification for Apache Spark (O'Reilly School of
Technology and Databriks), and Revolution R Enterprise-certified
Specialist Certifications. Apart from this, he has also cleared Financial
Risk Manager (FRM I) exam. His interest in mathematics helped him in
clearing the CT3 (Actuarial Science) exam.
Did you know that Packt offers eBook versions of every book
published, with PDF and ePub files available? You can upgrade to the
eBook version at www.PacktPub.com and as a print book customer, you
are entitled to a discount on the eBook copy. Get in touch with us
at service@packtpub.com for more details.
https://www.packtpub.com/mapt
Get the most in-demand software skills with Mapt. Mapt gives you full
access to all Packt books and video courses, as well as industry-leading
tools to help you plan your personal development and advance your
career.
Why subscribe?
Fully searchable across every book published by Packt
Copy and paste, print, and bookmark content
On demand and accessible via a web browser
Customer Feedback
Thank you for purchasing this Packt book. We take our commitment to
improving our content and products to meet your needs seriously—that's
why your feedback is so valuable. Whatever your feelings about your
purchase, please consider leaving a review on this book's Amazon page.
Not only will this help us, more importantly it will also help others in the
community to make an informed decision about the resources that they
invest in to learn. You can also review for us on a regular basis by
joining our reviewers' club. If you're interested in joining, or would
like to learn more about the benefits we offer, please contact us:
customerreviews@packtpub.com.
Preface
This book is about functional algorithms and data structures. Algorithms
and data structures are fundamentals of computer programming.
For example, reversing a singly linked list using three node pointers is a
well known algorithm. We scan the list once and reverse it by changing
the pointer fields of each node. The three pointer variables guide the
reversal process.
I have come across many such pointer tricks and have used them as
needed.
We slept easier, the code worked as expected, and all was well with the
world!
I could very well see why writing side-effect free code worked! I was
hooked and started playing with Scala, Clojure, and Erlang. Immutability
was the norm here.
All in good time though! Reading this book will help you see that we
need not sacrifice algorithmic performance while avoiding in-place
mutation!
You also need a text editor. Use whichever you are comfortable with.
Who this book is for
The book assumes some familiarity with basic data structures. You
should have played with fundamental data structures like linked lists,
heaps, and binary trees. It also assumes that you have written some code
in a functional language.
We try to site links that offer hands-on code snippets, so you can
practice them yourself.
A lot of thought has gone into making helpful diagrams. Quizzes and
exercises are included, so you can apply what you've learned.
All the code is available online. We strongly advocate keying in the code
snippets though, to internalize the principles and techniques.
Code words in text, database table names, folder names, filenames, file
extensions, pathnames, dummy URLs, user input, and Twitter handles
are shown as follows: "The following function f has a side effect,
though."
New terms and important words are shown in bold. Words that you
see on the screen, for example, in menus or dialog boxes, appear in the
text like this: "Clicking the Next button moves you to the next screen."
Note
Warnings or important notes appear in a box like this.
Tip
Tips and tricks appear like this.
Reader feedback
Feedback from our readers is always welcome. Let us know what you
think about this book—what you liked or disliked. Reader feedback is
important for us as it helps us develop titles that you will really get the
most out of.
If there is a topic that you have expertise in and you are interested in
either writing or contributing to a book, see our author guide at
www.packtpub.com/authors.
Customer support
Now that you are the proud owner of a Packt book, we have a number
of things to help you to get the most from your purchase.
Once the file is downloaded, please make sure that you unzip or extract
the folder using the latest version of:
WinRAR / 7-Zip for Windows
Zipeg / iZip / UnRarX for Mac
7-Zip / PeaZip for Linux
Errata
Although we have taken every care to ensure the accuracy of our
content, mistakes do happen. If you find a mistake in one of our books
—maybe a mistake in the text or the code—we would be grateful if you
could report this to us. By doing so, you can save other readers from
frustration and help us improve subsequent versions of this book. If you
find any errata, please report them by visiting
http://www.packtpub.com/submit-errata, selecting your book, clicking
on the Errata Submission Form link, and entering the details of your
errata. Once your errata are verified, your submission will be accepted
and the errata will be uploaded to our website or added to any list of
existing errata under the Errata section of that title.
Piracy
Piracy of copyrighted material on the Internet is an ongoing problem
across all media. At Packt, we take the protection of our copyright and
licenses very seriously. If you come across any illegal copies of our
works in any form on the Internet, please provide us with the location
address or website name immediately so that we can pursue a remedy.
Questions
If you have a problem with any aspect of this book, you can contact us
at questions@packtpub.com, and we will do our best to address the
problem.
Discovering Diverse Content Through
Random Scribd Documents
clustered around the brink of the pit to drink from the stores gathered
in those natural bowls which seem to have been hollowed out for the
uses of the invisible gnomes.
Beyond Cascade Hall commences Silliman’s Avenue, a passage
about twenty feet wide, forty or fifty in height, and a mile and a half in
length.
Our lamps were replenished and we entered El Ghor, which is by far
the most picturesque avenue in the cave. It is a narrow, lofty
passage meandering through the heart of a mass of horizontal strata
of limestone, the broken edges of which assume the most
remarkable forms. Now there are rows of broad, flat shelves
overhanging your head; now you sweep around the stern of some
mighty vessel with its rudder set hard to starboard; now you enter a
little vestibule with friezes and mouldings of almost Doric symmetry
and simplicity; and now you wind away into a Cretan labyrinth most
uncouth and fantastic, whereof the Minotaur would be a proper
inhabitant. It is a continual succession of surprises, and, to the
appreciative visitor, of raptures. The pass is somewhat more than a
mile and a half in length, and terminates in a curious knot or
entanglement of passages leading to two or more tiers of avenues.
We were now, according to Stephen’s promises, on the threshold of
wonders. Before proceeding further we stopped to drink from a fine
sulphur spring which fills a natural basin in the bottom of a niche
made on purpose to contain it. We then climbed a perpendicular
ladder, passing through a hole in the ceiling barely large enough to
admit our bodies, and found ourselves at the entrance of a narrow,
lofty passage leading upwards. When all had made the ascent the
guides exultingly lifted their lamps and directed our eyes to the rocks
overhanging the aperture; there was the first wonder, truly! Clusters
of grapes gleaming with blue and violet tints through the water which
trickled over them, hung from the cliffs, while a stout vine, springing
from the base and climbing nearly to the top, seemed to support
them. Hundreds on hundreds of bunches clustering so thickly as to
conceal the leaves, hang forever ripe and forever unplucked in that
marvellous vintage of the subterranean world. For whose hand shall
squeeze the black, infernal wine from grapes that grow beyond
Lethe?
Mounting for a short distance, this new avenue suddenly turned to
the left, widened, and became level; the ceiling is low, but beautifully
vaulted, and Washington’s Hall, which we soon reached, is circular,
and upwards of a hundred feet in diameter. This is the usual dining-
room of parties who go beyond the rivers. Nearly five hours had now
elapsed since we entered the cave, and five hours spent in that
bracing, stimulating atmosphere might well justify the longing
glances which we cast upon the baskets carried by the guides. Mr.
Miller had foreseen our appetites, and there were stores of venison,
biscuit, ham, and pastry, more than sufficient for all. We made our
midday, or rather midnight meal sitting, like the nymph who wrought
Excalibur
buried far below the green Kentucky forests, far below the forgotten
sunshine. For in the cave you forget that there is an outer world
somewhere above you. The hours have no meaning: Time ceases to
be; no thought of labour, no sense of responsibility, no twinge of
conscience intrudes to suggest the existence you have left. You walk
in some limbo beyond the confines of actual life, yet no nearer the
world of spirits. For my part, I could not shake off the impression that
I was wandering on the outside of Uranus or Neptune, or some
planet still more deeply buried in the frontier darkness of our solar
system.
Washington Hall marks the commencement of Elindo Avenue, a
straight hall about sixty feet wide, twenty in height, and two miles
long. It is completely encrusted from end to end with crystallizations
of gypsum, white as snow. This is the crowning marvel of the cave,
the pride and the boast of the guides. Their satisfaction is no less
than yours, as they lead you through the diamond grottoes, the
gardens of sparry efflorescence, and the gleaming vaults of this
magical avenue. We first entered the “Snow-ball Room,” where the
gnome-children in their sports have peppered the grey walls and
ceiling with thousands of snow-white projecting discs, so perfect in
their fragile beauty, that they seem ready to melt away under the
blaze of your lamp. Then commences Cleveland’s Cabinet, a gallery
of crystals, the richness and variety of which bewilder you. It is a
subterranean conservatory, filled with the flowers of all the zones; for
there are few blossoms expanding on the upper earth but are
mimicked in these gardens of Darkness. I cannot lead you from
niche to niche, and from room to room, examining in detail the
enchanted growths; they are all so rich and so wonderful that the
memory does not attempt to retain them. Sometimes the hard
limestone rock is changed into a pasture of white roses; sometimes it
is starred with opening daisies; the sunflowers spread their flat discs
and rayed leaves; the feathery chalices of the cactus hang from the
clefts; the night-blooming cereus opens securely her snowy cup, for
the morning never comes to close it; the tulip is here a virgin, and
knows not that her sisters above are clothed in the scarlet of shame.
In many places the ceiling is covered with a mammary crystallization,
as if a myriad bubbles were rising beneath its glittering surface. Even
on this jewelled soil which sparkles all around you, grow the lilies
and roses, singly overhead, but clustering together towards the base
of the vault, where they give place to long, snowy, pendulous cactus-
flowers, which droop like a fringe around diamonded niches. Here
you see the passion-flower, with its curiously curved pistils; there an
iris with its lanceolate leaves; and again, bunches of celery with
stalks white and tender enough for a fairy’s dinner. There are
occasional patches of gypsum, tinged of a deep amber colour by the
presence of iron. Through the whole length of the avenue there is no
cessation of the wondrous work. The pale rock-blooms burst forth
everywhere, crowding on each other until the brittle sprays cannot
bear their weight, and they fall to the floor. The slow, silent
efflorescence still goes on, as it has done for ages in that buried
tropic.
What mostly struck me in my underground travels was the evidence
of design which I found everywhere. Why should the forms of the
earth’s outer crust, her flowers and fruits, the very heaven itself
which spans her, be so wonderfully reproduced? What laws shape
the blossoms and the foliage of that vast crystalline garden? There
seemed to be something more than the accidental combinations of a
blind chance in what I saw—some evidence of an informing and
directing Will. In the secret caverns, the agencies which produced
their wonders have been at work for thousands of years, perhaps
thousands of ages, fashioning the sparry splendours in the womb of
darkness with as exquisite a grace, as true an instinct of beauty as in
the palm or the lily, which are moulded by the hands of the sun.
What power is it which lies behind the mere chemistry of Nature,
impregnating her atoms with such subtle laws of symmetry? What
but Divine Will, which first gave her being, and which is never weary
of multiplying for man the lessons of His infinite wisdom?
At the end of Elindo Avenue the floor sinks, then ascends, and is at
last blocked up by a huge pile of large, loose rocks. When we had
reached the foot, the roof of the avenue suddenly lifted and
expanded, and the summit of the Rocky Mountains, as they are
called, leaned against a void waste of darkness. We climbed to the
summit, about a hundred feet above, whence we looked down into
an awful gulf, spanned far above our heads by a hollow dome of
rock. The form of this gigantic hall was nearly elliptical. It was
probably 150 feet in height, by 500 in length, the ends terminating
near the roof in the cavernous mouths of other avenues. The guides
partly descended the hill and there kindled a brilliant Bengal light,
which disclosed more clearly the form of the hall, but I thought it
more impressive as its stupendous proportions were first dimly
revealed by the light of our lamps. Stephen, who discovered this
place, gave it the name of the Dismal Hollow.
Scrambling along the ridge of the Rocky Mountains, we gained the
entrance to the cavern opening on the left, which we followed for
about two hundred yards, when it terminated in a lofty circular dome,
called Crogan’s Hall. The floor on one side dropped suddenly into a
deep pit, around which were several cushions of stalagmite,
answering to short stalactites, hanging from the ceiling far above. At
the extremity of the hall was a sort of recess, formed by stalactitic
pillars. The wall behind it was a mass of veined alabaster. “Here,”
said Stephen, “is your Ultima Thule. This is the end of the Mammoth
Cave, nine miles from daylight.” But I doubt whether there is really
an end of the cave any more than an end of the earth.
Notwithstanding the ground we had traversed, we had left many vast
avenues unexplored, and a careful search would no doubt lead to
further discoveries.
We retraced our steps slowly along Elindo Avenue, stopping every
few minutes to take a last look at the bowers of fairy blossoms. After
reaching Washington’s Hall we noticed that the air was no longer
still, but was flowing fresh and cool in our faces. Stephen observed it
also, and said: “There has been a heavy rain outside.” Entering the
pass of El Ghor again at Martha’s Vineyard, we walked rapidly
forward, without making a halt, to its termination at Silliman’s
Avenue. The distance is reckoned by the guides at a little more than
a mile and a half, and we were just forty minutes in walking it. We
several times felt fatigue, especially when passing the rougher parts
of the cave, but the sensation always passed away in some
unaccountable manner, leaving us fresh and buoyant. The crossing
of the rivers was accomplished with some labour, but without
accident. I accompanied Stephen on his return through the second
arch of Echo River. As I sat alone in the silent, transparent darkness
of the mysterious stream, I could hear the tones of my boatman’s
voice gliding down the caverns like a wave, flowing more and more
faintly until its vibrations were too weak to move the ear. Thus, as he
sang, there were frequently three or four notes, each distinctly
audible, floating away at different degrees of remoteness. At the last
arch there was only a space of eighteen inches between the water
and the rock. We lay down on our backs in the muddy bottom of the
boat, and squeezed through to the middle branch of Echo River,
where we found the rest of the party, who had gone round through
Purgatory.
After again threading Fat Man’s Misery, passing the Bottomless Pit
and the Deserted Chambers, we at last emerged into the Main
Avenue at the Giant’s Coffin. It was six o’clock, and we had been ten
hours in the cave.
When we heard the tinkling drops of the little cascade over the
entrance, I looked up and saw a patch of deep, tender blue set in the
darkness. In the midst of it twinkled a white star—whiter and more
dazzling than any star I ever saw before. I paused and drank at the
trough under the waterfall, for, like the Fountain of Trevi at Rome, it
may be that those who drink there shall return again. When we
ascended to the level of the upper world we found that a fierce
tornado had passed along during the day; trees had been torn up by
the roots and hurled down in all directions; stunning thunders had
jarred the air, and the wet earth was fairly paved with leaves cut off
by the heavy hail—yet we, buried in the heart of the hills, had heard
no sound, nor felt the slightest tremour in the air.
The stars were all in their places as I walked back to the hotel. I had
been twelve hours under ground, in which I had walked about
twenty-four miles. I had lost a day—a day with its joyous morning, its
fervid noon, its tempest, and its angry sunset of crimson and gold;
but I had gained an age in a strange and hitherto unknown world—
an age of wonderful experience, and an exhaustless store of sublime
and lovely memories.
At Home and Abroad (New York, 1864).
STROMBOLI
(SICILY)
ALEXANDRE DUMAS
As we advanced, Stromboli became more and more distinct every
moment, and through the clear evening air we could perceive every
detail; this mountain is formed exactly like a hay-mow, its summit
being surmounted by a peak; it is from this summit that the smoke
escapes, and, at intervals of a quarter of an hour, a flame; during the
daytime this flame does not apparently exist, being lost in the light of
the sun; but when evening comes, and the Orient begins to darken,
this flame becomes visible and you can see it dart forth from the
midst of the smoke which it colours, and fall again in jets of lava.
Towards seven o’clock we reached Stromboli; unfortunately the port
is in the east, and we came from the west; so that we had to coast
along the whole length of the island where the lava descended down
a sharp slope into the sea. For a breadth of twenty paces at its
summit and a hundred and fifty at its base, the mountain at this point
is covered with cinders and all vegetation is burned.
The captain was correct in his predictions: we arrived half an hour
after the port had been closed; all we could say to make them open
to us was lost eloquence.
However, the entire population of Stromboli had run to the shore.
Our Speronare was a frequent visitor to this harbour and our sailors
were well known in the island.... It was in Stromboli that Æolus held
bound the luctantes ventos tempestatesque sonoras. Without doubt,
at the time of the song of Æneas, and when Stromboli was called
Strongyle, the island was not known for what it really is, and hid
within its depths the boiling masses and periodical ejaculations
which make this volcano the most obliging one in the world. In sooth,
you know what to expect from Stromboli: it is not like Vesuvius or
Etna, which make the traveller wait sometimes three, five or even ten
years for a poor little eruption. I have been told that this is doubtless
owing to the position they hold in the hierarchy of fire-vomiting
mountains, a hierarchy that permits them to be aristocratic at their
own pleasure: this is true enough; and we must not take it amiss if
Stromboli allows her social position to be assailed an instant, and to
have understood that it is only a little toy volcano to which one would
not pay the slightest attention if it made itself so ridiculous as to put
on airs.
Moreover, it did not keep us waiting. After scarcely five minutes’
expectation, a heavy rumbling was heard, a detonation resembling
twenty cannon fired in succession, and a long jet of flame leaped into
the air and fell again in a shower of lava; a part of this shower fell
again into the crater of the volcano, while the other, rolling down the
slope hurried like a brooklet of flame to extinguish itself, hissing, into
the sea. Ten minutes later the same phenomenon was repeated, and
at every succeeding ten minutes throughout the night.
I admit that this was one of the most curious nights I ever spent in
my life; neither Jadin nor I could tear ourselves away from this
terrible and magnificent spectacle. There were such detonations that
the very atmosphere seemed excited, and you imagined the whole
island trembling like a frightened child; it was only Milord that these
fire-works put into a state of exaltation impossible to describe; he
wanted to jump into the water every moment to devour the burning
lava which sometimes fell ten feet from us, like a meteor precipitating
itself into the sea.
As for our boatswain, he was so accustomed to this spectacle, that,
after asking if we needed anything and upon our reply in the
negative, he retired between decks and neither the lightnings that
illuminated the air nor the thunders that shook it had power to disturb
his slumbers.
We stayed here until two o’clock; finally, overcome with fatigue and
sleep, we decided to retire to our cabin. As for Milord, nothing would
persuade him to do as we did and he stayed all night on deck,
growling and barking at the volcano.
We woke in the morning at the first movement of the Speronare.
With the return of daylight the mountain lost all its fantastic
appearance.
We constantly heard the detonations; but the flame had become
invisible; and that burning lava stream of the night was confused in
the day with the reddish ashes over which it rolls.
Ten minutes more and we were again in port. This time we had no
difficulty in entering. Pietro and Giovanni got off with us; they wished
to accompany us on our ascent.
We entered, not an inn (there are none in Stromboli), but a house
whose proprietors were related to our captain. As it would not have
been prudent to have started on our way fasting, Giovanni asked
permission of our hosts to make breakfast for us while Pietro went to
hunt for guides,—a permission not only accorded to us with much
grace but our host also went out and came back in a few moments
with the most beautiful grapes and figs that he could find.
After we had finished our breakfast, Pietro arrived with two
Stromboliotes who consented, in consideration of half a piastre each,
to serve as guides. It was already nearly eight o’clock: to avoid a
climb in the greatest heat of the day, we started off immediately.
The top of Stromboli is only twelve or fifteen hundred feet above the
level of the sea; but its slope is so sharp that you cannot climb in a
direct manner, but must zigzag eternally. At first, on leaving the
village, the road was easy enough; it rose in the midst of those vines
laden with grapes that make the commerce of the island and from
which the fruit hangs in such great quantity that any one may help
himself to all he wants without asking the permission of the owner;
however, upon leaving the region of the vineyards, we found no
more roads, and we had to walk at random, looking for the best
ground and the easiest slopes. Despite all these precautions, there
came a moment when we were obliged to scramble on all fours:
there was nothing to do but climb up; but this place once passed, I
vow that on turning around and seeing it, jutting almost
perpendicularly over the sea, I asked in terror how we could ever
descend; our guides then said that we would come down by another
road: that pacified me a little. Those who like myself are unhappy
enough to have vertigo when they see a chasm below their feet will
understand my question and still more the importance I attached to
it.
This break-neck spot passed, the ascent became easier for a quarter
of an hour; but soon we came to a place which at the first glance
seemed impassable; it was a perfectly sharp-pointed angle that
formed the opening of the first volcano, and part of which was cut out
perpendicularly upon the crater while the other fell with so sharp a
slope to the sea that it seemed to me if I should fall perpendicularly
on the other side I could not help rolling from top to bottom. Even
Jadin, who ordinarily climbs like a chamois without ever troubling
about the difficulties of the ground, stopped short when we came to
this passage, asking if there was not some way to avoid it. As you
may imagine, this was impossible.
The crater of Stromboli is formed like a vast funnel, from the bottom
and the centre of which is an opening through which a man can
enter a little way, and which communicates with the internal furnace
of the mountain; it is through this opening, resembling the mouth of a
canon, that the shower of projectiles darts forth, which, falling again
into the crater, sweeps with it down the inclined slope of stones the
cinders and lava that, rolling to the bottom, block up that funnel.
Then the volcano seems to gather its forces together for several
minutes, compressed as it is by the stoppage of its valve; but after a
moment its smoke trembles like a breath; you hear a deep roaring
run through the hollow sides of the mountain; then the cannonade
bursts forth again, throwing up two hundred feet above the summit
new stones and new lava, which, falling back and closing the orifice
of the passage anew, prepare for a new outburst.
Seen from where we were, that is from top to bottom, this spectacle
was superb and terrifying; at each internal convulsion that the
mountain essayed, you felt it tremble beneath you, and it seemed as
if it would burst asunder; then came the explosion, similar to a
gigantic tree of flame and smoke that shook its leaves of lava.
Finally, we reached the extremity of this new lake of Sodom, and we
found ourselves in an oasis of vines, pomegranates and olives. We
had not the courage to go any farther. We lay down in the grass, and
our guides brought us an armful of grapes and a hatful of figs.
It was marvellous to us; but there was not the smallest drop of water
for our poor Milord to drink, and we perceived him devouring the skin
of the figs and grapes. We gave him part of our repast, and for the
first, and probably for the last, time in his life he dined off figs and
grapes.
I have often a desire to put myself in the place of Milord and write his
memoirs as Hoffmann wrote those of his cat, Murr. I am convinced
that he must have had, seen from the canine point of view, (I beg the
Académie’s pardon for the expression) extremely new impressions
of the people and countries that he has visited.
A quarter of an hour after this halt we were in the village, writing
upon our tablets this judicious observation—that the volcanoes
follow but do not resemble each other: we were nearly frozen when
ascending Etna, and we were nearly roasted when descending
Stromboli.
Jadin and I each extended a hand towards the mountain and swore
that notwithstanding Vesuvius, Stromboli was the last volcano whose
acquaintance we would make.
Le Capitaine Aréna: Impressions de Voyage (Paris, 1836).
THE HIGH WOODS
(SOUTH AMERICA)
CHARLES KINGSLEY
In the primeval forest, looking upon that which my teachers and
masters, Humboldt, Spix, Martius, Schomburgk, Waterton, Bates,
Wallace, Gosse, and the rest, had looked already, with far wiser eyes
than mine, comprehending somewhat at least of its wonders, while I
could only stare in ignorance. There was actually, then, such a sight
to be seen on earth; and it was not less, but far more wonderful than
they had said.
My first feeling on entering the high woods was helplessness,
confusion, awe, all but terror. One is afraid at first to venture in fifty
yards. Without a compass or the landmark of some opening to or
from which he can look, a man must be lost in the first ten minutes,
such a sameness is there in the infinite variety. That sameness and
variety make it impossible to give any general sketch of a forest.
Once inside, “you cannot see the woods for the trees.” You can only
wander on as far as you dare, letting each object impress itself on
your mind as it may, and carrying away a confused recollection of
innumerable perpendicular lines, all straining upwards, in fierce
competition, towards the light-food far above; and next on a green
cloud, or rather mist, which hovers round your head, and rises,
thickening and thickening to an unknown height. The upward lines
are of every possible thickness, and of almost every possible hue;
what leaves they bear, being for most part on the tips of the twigs,
give a scattered, mist-like appearance to the under-foliage. For the
first moment, therefore, the forest seems more open than an English
wood. But try to walk through it, and ten steps undeceive you.
Around your knees are probably Mamures, with creeping stems and
fan-shaped leaves, something like those of a young cocoanut palm.
You try to brush among them, and are caught up instantly by a string
or wire belonging to some other plant. You look up and round: and
then you find that the air is full of wires—that you are hung up in a
network of fine branches belonging to half-a-dozen different sorts of
young trees, and intertwined with as many different species of
slender creepers. You thought at your first glance among the tree-
stems that you were looking through open air; you find that you are
looking through a labyrinth of wire-rigging, and must use the cutlass
right and left at every five steps. You push on into a bed of strong
sedge-like Sclerias, with cutting edges to their leaves. It is well for
you if they are only three, and not six feet high. In the midst of them
you run against a horizontal stick, triangular, rounded, smooth,
green. You take a glance along it right and left, and see no end to it
either way, but gradually discover that it is the leaf-stalk of a young
Cocorite palm. The leaf is five-and-twenty feet long, and springs from
a huge ostrich plume, which is sprawling out of the ground and up
above your head a few yards off. You cut the leaf-stalk through right
and left, and walk on, to be stopped suddenly (for you get so
confused by the multitude of objects that you never see anything till
you run against it) by a grey lichen-covered bar, as thick as your
ankle. You follow it up with your eye, and find it entwine itself with
three or four other bars, and roll over with them in great knots and
festoons and loops twenty feet high, and then go up with them into
the green cloud over your head, and vanish, as if a giant had thrown
a ship’s cable into the tree-tops. One of them, so grand that its form
strikes even the Negro and the Indian, is a Liantasse. You see that at
once by the form of its cable—six or eight inches across in one
direction, and three or four in another, furbelowed all down the
middle into regular knots, and looking like a chain cable between two
flexible iron bars. At another of the loops, about as thick as your arm,
your companion, if you have a forester with you, will spring joyfully.
With a few blows of his cutlass he will sever it as high up as he can
reach, and again below, some three feet down; and, while you are
wondering at this seemingly wanton destruction, he lifts the bar on
high, throws his head back, and pours down his thirsty throat a pint
or more of pure cold water. This hidden treasure is, strange as it may
seem, the ascending sap, or rather the ascending pure rain-water
which has been taken up by the roots, and is hurrying aloft, to be
elaborated into sap, and leaf, and flower, and fruit, and fresh tissue
for the very stem up which it originally climbed; and therefore it is
that the woodman cuts the Watervine through first at the top of the
piece which he wants, and not at the bottom; for so rapid is the
ascent of the sap that if he cut the stem below, the water would have
all fled upwards before he could cut it off above. Meanwhile, the old
story of Jack and the Bean-stalk comes into your mind. In such a
forest was the old dame’s hut; and up such a bean-stalk Jack
climbed, to find a giant and a castle high above. Why not? What may
not be up there? You look up into the green cloud, and long for a
moment to be a monkey. There may be monkeys up there over your
head, burly red Howler, or tiny peevish Sapajou, peering down at
you; but you cannot peer up at them. The monkeys, and the parrots,
and the humming-birds, and the flowers, and all the beauty, are
upstairs—up above the green cloud. You are in “the empty nave of
the cathedral,” and “the service is being celebrated aloft in the
blazing roof.”
Our website is not just a platform for buying books, but a bridge
connecting readers to the timeless values of culture and wisdom. With
an elegant, user-friendly interface and an intelligent search system,
we are committed to providing a quick and convenient shopping
experience. Additionally, our special promotions and home delivery
services ensure that you save time and fully enjoy the joy of reading.
textbookfull.com