Instant Download JavaScript Data Structures and Algorithms: An Introduction to Understanding and Implementing Core Data Structure and Algorithm Fundamentals 1st Edition Sammie Bae PDF All Chapters
Instant Download JavaScript Data Structures and Algorithms: An Introduction to Understanding and Implementing Core Data Structure and Algorithm Fundamentals 1st Edition Sammie Bae PDF All Chapters
com
OR CLICK HERE
DOWLOAD NOW
https://ebookmeta.com/product/new-generation-korean-beginner-level-
second-edition-mihyon-jeon/
ebookmeta.com
Successful Supervision and Leadership Ensuring High
Performance Outcomes Using the PASE Model 1st Edition
Tracey Harris
https://ebookmeta.com/product/successful-supervision-and-leadership-
ensuring-high-performance-outcomes-using-the-pase-model-1st-edition-
tracey-harris/
ebookmeta.com
https://ebookmeta.com/product/clinical-interviewing-6e-sixth-edition-
john-sommers-flanagan/
ebookmeta.com
https://ebookmeta.com/product/one-road-to-riches-haakon-gjerlow/
ebookmeta.com
https://ebookmeta.com/product/nationalism-referendums-and-democracy-
voting-on-ethnic-issues-and-independence-2nd-edition-matt-qvortrup-
editor/
ebookmeta.com
https://ebookmeta.com/product/a-strange-habit-of-mind-cameron-
winter-2-1st-edition-andrew-klavan/
ebookmeta.com
Songs Words 2016th Edition Ginger Wildheart
https://ebookmeta.com/product/songs-words-2016th-edition-ginger-
wildheart/
ebookmeta.com
JavaScript Data
Structures and
Algorithms
An Introduction to Understanding and
Implementing Core Data Structure and
Algorithm Fundamentals
—
Sammie Bae
JavaScript Data Structures
and Algorithms
An Introduction to Understanding
and Implementing Core Data
Structure and Algorithm
Fundamentals
Sammie Bae
JavaScript Data Structures and Algorithms
Sammie Bae
Hamilton, ON, Canada
Introduction������������������������������������������������������������������������������������������������������������xxi
v
Table of Contents
vi
Table of Contents
String Shortening������������������������������������������������������������������������������������������������������������������������ 43
Encryption����������������������������������������������������������������������������������������������������������������������������������� 45
RSA Encryption���������������������������������������������������������������������������������������������������������������������� 46
Summary������������������������������������������������������������������������������������������������������������������������������� 50
vii
Table of Contents
Chapter 8: Recursion���������������������������������������������������������������������������������������������� 99
Introducing Recursion����������������������������������������������������������������������������������������������������������������� 99
Rules of Recursion�������������������������������������������������������������������������������������������������������������������� 100
Base Case���������������������������������������������������������������������������������������������������������������������������� 100
Divide-and-Conquer Method����������������������������������������������������������������������������������������������� 101
Classic Example: Fibonacci Sequence�������������������������������������������������������������������������������� 101
Fibonacci Sequence: Tail Recursion������������������������������������������������������������������������������������ 102
Pascal’s Triangle������������������������������������������������������������������������������������������������������������������ 103
Big-O for Recursion������������������������������������������������������������������������������������������������������������������� 105
Recurrence Relations���������������������������������������������������������������������������������������������������������� 105
Master Theorem������������������������������������������������������������������������������������������������������������������ 106
Recursive Call Stack Memory��������������������������������������������������������������������������������������������������� 107
Summary���������������������������������������������������������������������������������������������������������������������������������� 109
Exercises����������������������������������������������������������������������������������������������������������������������������������� 109
viii
Table of Contents
ix
Table of Contents
x
Table of Contents
xi
Table of Contents
xii
Table of Contents
xiii
Table of Contents
Index��������������������������������������������������������������������������������������������������������������������� 351
xiv
About the Author
Sammie Bae is a data engineer at Yelp and previously
worked for the data platform engineering team at
NVIDIA. He developed a deep interest in JavaScript
during an internship at SMART Technologies (acquired by
Foxconn), where he developed Node.js-based JavaScript
APIs for serial port communication between electronic
board drivers and a web application. Despite how relevant
JavaScript is to the modern software engineering industry,
currently no books besides this one teach algorithms and
data structures using JavaScript. Sammie understands how
difficult these computer science concepts are and aims to
provide clear and concise explanations in this book.
xv
Other documents randomly have
different content
PLATE CCCXXV.
CODON ROYENI.
Prickly Codon.
CLASS XI. ORDER I.
DODECANDRIA MONOGYNIA. Twelve Chives. One Pointal.
GENERIC CHARACTER.
Calyx. Perianthium monophyllum, duodecempartitum; foliolis subulatis,
persistentibus, erectis, alternis brevioribus.
Corolla monopetala, campanulata, basi torulosa; limbo
duodecimpartito, aquali.
Nectarium duodecim loculare ex squamis 12, unguibus staminum insertis,
conniventibus, receptaculum tegentibus.
Stamina. Filamenta duodecim, longitudine corollæ. Antheræ crassæ.
Pistillum. Germen superum, conicum. Stylus simplex, longitudine
staminum. Stigmata duo, longa, setacea, divergentia.
Pericarpium. Capsula bilocularis.
Semina plurima, subrotunda, nigra.
Empalement. Cup one-leaf, twelve-divided; leaflets awl-shaped,
remaining, upright, the alternate ones shorter.
Blossom one petal, bell-shaped, rather swelled at the base; border twelve-
divided, equal.
Honey-cup twelve-celled, consisting of 12 scales, inserted into the claws of
the chives, approaching, covering the receptacle.
Chives. Twelve threads, the length of the blossom. Tips thick.
Pointal. Seed-bud above, conical. Shaft simple, the length of the chives.
Summits two, long, like bristles, straddling.
Seed Vessel. Capsule two-celled.
Seeds numerous, roundish, black,
SPECIFIC CHARACTER.
Codon foliis alternis, cordato-ovatis, acuminatis, setaceo-spinosis;
floribus subcapitatis, terminalibus.
Codon with alternate leaves, between heart-shaped and oval, tapered to
the point, with spine-like bristles; flowers grow nearly in heads, terminating
the branches.
REFERENCE TO THE PLATE.
1. The Empalement.
2. A Blossom spread open, with the chives in their place.
3. The same shewn from the outside.
4. The Seed-bud, Shaft and Summits.
5. The Seed-bud, cut transversely.
As an interesting desideratum, this plant has stood long amongst botanical
collectors; but till the year 1801, it was never seen, in a vegetating state, in
Britain; at which period, it was introduced to our gardens, by Mr. Niven,
from the Cape of Hope. It is not, we believe, (although considered hitherto
as such,) an annual; but rather, a half woody shrub, easily destroyed by
moisture. As the seed appears to ripen freely, although there seems no other
mode of perpetuating the plant, we shall stand in no danger of losing it; its
attractions are, indeed, not great as to beauty, but much so as to singularity;
since we have no plant to which it affines in general habit. The seeds should
be sown on a gentle hot-bed, in March, and transplanted when about two
inches high, into pots, to flower, which they will do about September. Our
drawing was made at the Hammersmith Nursery. Having had the opportunity
of examining the flowers, of more than twenty plants; we are convinced it
has been wrong placed by Van Royen to decandria; for although many
flowers may be found, even on the same plant, some with eight, others with
ten chives, yet at least 90 out of 100 have twelve; wherefore we have,
without scruple, placed it to dodecandria.
PLATE CCCXXVI.
PHARNACEUM LINEARE.
Linear-leaved Pharnaceum.
CLASS V. ORDER III.
PENTANDRIA TRIGYNIA. Five Chives. Three Pointal.
GENERIC CHARACTER.
Calyx. Perianthium pentaphyllum; foliolis subovatis, concavis,
patentibus, æqualibus, persistentibus, intus coloratus, margine tenui.
Corolla nulla; hinc calycis margo tenuis et calyx interne coloratus.
Stamina. Filamenta quinque, subulata, longitudine calycis. Antheræ basi
bifidæ.
Pistilla. Germen ovatum, trigonum. Styli tres, filiformes, longitudine
staminum. Stigmata obtusa.
Pericarpium. Capsula ovata, obsoletè trigona, tecta, trilocularis, trivalvis.
Semina numerosa, nitida, orbiculata, depressa, margine acuto cincta.
Empalement. Cup five-leaved; leaflets nearly egg-shaped, concave,
spreading, equal, permanent, coloured within, with a thin edge.
Blossom none; hence the edge of the cup is thin and the inside of it is
coloured.
Chives. Five-threads, awl-shaped, the length of the cup. Tips cleft at the
base.
Pointals. Seed-bud egg-shaped, three-sided. Shafts three, thread-shaped,
the length of the chives. Summits blunt.
Seed-vessel. Capsule egg-shaped, bluntly three-cornered, covered, three-
celled, three valves.
Seeds numerous, shining, orbicular, flattened, surrounded by a sharp rim.
SPECIFIC CHARACTER.
Pharnaceum foliis linearibus, verticillatis; umbellis inequalibus; calycibus
aurantiis; caule decumbente.
Pharnaceum with linear leaves, growing in whorls; umbels unequal; cups
orange coloured; stem bending downwards.
REFERENCE TO THE PLATE.
1. The Cup, shewn from the front, with the chives.
2. The same, shewn from the hind part attached to the fruit-stalk.
3. The Seed-bud and Pointals, natural size.
4. The same, magnified.
5. The Seed-bud, cut transversely, magnified.
This little plant much resembles our Corn Spurry, or Spergula arvensis, at
first sight. It is a native of the Cape of Good Hope, seldom grows more than
six inches high, and is very apt to be destroyed by the damps of our winters.
It should be placed in the airyest part of the greenhouse, and kept in light
sandy loam. To propagate it, the cuttings should be put in, about the month
of March, in the heat of a gentle hot-bed, or the bark-bed of the hot-house;
the seeds are sometimes perfected. It has been often introduced to us, but as
often lost; as it is not a plant of much shew, no great deal of pains has,
hitherto, been taken for its preservation. Our drawing was taken from a plant
in the Hibbertian Collection, in the month of July, 1802.
PLATE CCCXXVII.
XERANTHEMUM ARGENTEUM.
Silvery Everlasting-Flower.
CLASS XIX. ORDER II.
SYNGENESIA POLYGAMIA SUPERFLUA. Tips united. Superfluous
Pointals.
ESSENTIAL GENERIC CHARACTER.
Receptaculum paleaceum. Pappus setaceus. Calyx imbricatus, radiatus;
radio colorato.
Receptacle chaffy. Feather bristly. Cup tiled, rayed; ray coloured.
See Xeranthemum speciocissimum, V. I. Pl. LI.
SPECIFIC CHARACTER.
Xeranthemum fruticosum; foliis lanceolatis, carinatis, sericeis; floribus
paniculatis, argenteis.
Everlasting flower with a shrubby stem; leaves lance-shaped, keeled, and
silky; flowers grow in panicles, and silvery.
REFERENCE TO THE PLATE.
1. An hermaphrodite Floret, natural size.
2. The same, magnified.
3. An inner scale of the Empalement.
4. The Receptacle, cleared of the scales and florets.
5. A female Floret, magnified.
6. The Pointal of the above, natural size.
7. The same magnified.
This new species of Everlasting-flower was introduced to us, at the same
time, with the X. spirale this work, Pl. CCLXII. by Montague Burgoyne,
Esq. of Mark Hall, Essex, in the year 1801. It is a quick growing plant, and
has flowered for the first time last April, when our drawing was taken. The
flower stems grow to the length of eighteen inches, or more; and the buds,
upon their first appearance, have a fine tint of flesh colour, which, however,
totally disappears upon the expansion of the flower. It is propagated by
cuttings, seeds, (which ripen in this country,) or by parting the branches at
the root, as it makes many from one base, which are easily separated by
passing a knife between them. It thrives best in sandy peat with a small
portion of loam, and must be kept in an airy, dry part of the greenhouse.
PLATE CCCXXVIII.
GERANIUM BUBONIFOLIUM.
Macedonian-Parsley-leaved Geranium.
CLASS XVI. ORDER IV.
MONADELPHIA DECANDRIA. Threads united. Ten Chives.
ESSENTIAL GENERIC CHARACTER.
Monogyna. Stigmata quinque. Fructus rostratus, pentacoccus.
One Pointal. Five Summits. Fruit furnished with long awns, five dry
berries.
SPECIFIC CHARACTER.
Geranium foliis pinnatis, pinnis oppositis, lobatis, distantibus, lobis
inciso-dentatis, glabris; petalis emarginatis, albis; staminibus quinque
fertilibus; radice tuberosa.
Geranium with winged leaves, wings opposite, lobed, distant, lobes deep
cut and toothed, smooth; petals notched at the end, white, five fertile chives;
root tuberous.
REFERENCE TO THE PLATE.
1. The Cup cut and spread open.
2. The Chives and Pointal.
3. The Chives cut and spread open, magnified.
4. The Pointal, magnified.
This Geranium, from the Cape of Good Hope, is quite distinct in its habit,
from most of the tuberous species; the leaflets or wings of the leaves being
more hand-shaped, and at a greater distance from each other, than in any
which has come under our observation; having much the appearance of those
of the plant from which we have derived its specific title. The plant was
introduced by Mr. Niven, to the Clapham Collection, in 1800; where our
drawing was taken in the month of June, 1802. The cultivation as usual, for
the plants of this branch of the Geranium family.
PLATE CCCXXIX.
P H A R N A C E U M L I N E A R E . Va r. f l o . a l b o .
Linear-leaved Pharnaceum. White Var.
CLASS V. ORDER III.
PENTANDRIA TRIGYNIA. Five Chives. Three Pointals.
ESSENTIAL GENERIC CHARACTER.
Calyx 5-phyllus. Corolla nulla.
Capsula 3-locularis, polysperma.
Cup 5-leaved. Blossom none.
Capsule 3-celled, many-seeded.
See Pharnaceum lineare. Pl. CCCXXVI. V. V.
SPECIFIC CHARACTER.
N Y M P H Æ A S T E L L ATA .
Starr’d Water-Lily.
CLASS XIII. ORDER I.
POLYANDRIA MONOGYNIA. Many Chives. One Pointal.
ESSENTIAL GENERIC CHARACTER.
Calyx 4, 5, seu 6-phyllus. Cor. polypetala. Bacca multilocularis, truncata.
Cup 4, 5 or 6-leaved. Bloss. many petals. Berry many-celled, appearing
cut off at top.
See Nymphæa cœrulea, Pl. CXCVII. Vol. III.
SPECIFIC CHARACTER.
Nymphæa foliis subrotundis, sinuatis, subtus purpurascentibus; lobis
divaricatis, acutis; calyce tetraphyllo, petalis acutis cœruleis longiore.
Water-lily with nearly round leaves, scollopped and purplish underneath;
lobes straddling and pointed; cup four-leaved, longer than the pointed, blue
petals.
REFERENCE TO THE PLATE.
1. The Cup divested of the petals.
2. A Chive, natural size.
3. The seed-vessel, nearly arrived to maturity.
4. The same, cut transversely.
This fine species of Water-lily is a native of the East Indies, on the Malabar
coast; and has been given by Rheed, in his Hortus Malabaricus, Vol. II. p.
53. fig. 27. At first sight, it has much the appearance of N. cœrulea, but upon
closer inspection it is found to possess many strongly differing characters,
viz. In this, the under part of the leaves are purplish, the lobes straddle; in
that, they are tiled, or lay upon each other; in N. stellata the petals or chives
seldom exceed ten; whereas, the N. cœrulea has an indefinite number of
both. The roots, likewise, are perfectly distinct; in N. cœrulea the diverging
roots proceed from the lower part of the bulb, from whence the leaves issue,
but in N. stellata from the top, leaving below them a smooth top-shaped
bulb. The parts which compose the summit, or rather the summits, (for
indeed we should consider them, if it lay with us, as distinct pointals,) are
expanded horizontally when the flower is in its perfect state, forming a star
like appearance, whence its specific name. It is much tenderer than N.
cœrulea, and will not flower but in strong heat. Mr. Anderson informs us that
the plants which have produced perfect seeds, this year, were from seeds,
received by A. B. Lambert, Esq. (communicated by Dr. Roxburgh from
India) in the month of March, and raised by him for the collection of J. Vere,
Esq. Kensington Gore, where our drawing was made in August.
PLATE CCCXXXI.
X Y L O P H Y L L A FA L C ATA .
Cymitar-shaped-leaved Xylophylla.
CLASS XXI. ORDER III.
MONŒCIA TRIANDRIA. Chives and Pointals separate. Three Chives.
GENERIC CHARACTER.
* Masculi flores.
Calyx. Perianthium monophyllum, tripartitum, coloratum; laciniis ovatis,
patulis, ovatis.
Corolla. Petala tria, ovata, concava.
Stamina. Filamenta tria, brevissima, basi approximata. Antheræ
subrotundæ, didymæ.
* Feminei flores in eodem fasciculo cum masculis.
Calyx. Perianthium ut in mare.
Corolla ut in mare.
Nectarium corpusculis glandulosis germen ambientibus.
Pistillum. Germen subrotundum, trisulcatum. Styli tres, patuli, bifidi.
Stigmata obtusa.
Pericarpium. Capsula trigona, trisulca, trilocularis; loculis bivalvibus.
Semina solitaria.
* Male flowers.
Empalement. Cup one leaf, three divided, coloured; segments egg-shaped,
spreading, oval.
Blossom. Petals three, egg-shaped, concave.
Chives. Threads three, very short, and approaching at the base. Tips
roundish, double.
* Female flowers in the same tuft with the males.
Empalement. Cup as in the male.
Blossom as in the male.
Honey-cup is formed of small glandular bodies surrounding the seed-bud.
Pointal. Seed-bud roundish, three-furrowed. Shafts three, short.
Summits blunt.
Seed-vessel. Capsule three-sided, three-furrowed, three cells; cells two-
valved.
Seeds solitary.
SPECIFIC CHARACTER.
Xylophylla foliis sparsis, integris, falcatis, crenatis; crenis remotis,
floriferis; floribus rubris.
Xylophylla with leaves scattered on the stem, entire, cymitar-shaped and
scolloped; the scollops distant, and having the flowers on them; flowers red.
REFERENCE TO THE PLATE.
1. A male flower, magnified.
2. The blossom of male flowers, spread open, with the honey-cups.
3. A Female flower, magnified.
4. The Germ from a female flower, cut transversely, magnified.
It should seem that this Genus has not been observed with sufficient
accuracy, at least those plants known to us, and which have been treated of
as belonging to the class Pentandria. The present one, for instance, which is
unquestionably the plant designed by Swartz, Commelin, Seba, &c. an is
acknowledged by Swartz to be triandrous and monœcious, yet that it should
be continued in the Kew Catalogue and by Willdenow, &c. to Pentandria, is
astonishing. We have no hesitation in declaring our opinion that the whole
genus as it now stands ought to be thrown to Phyllanthus. But, as the title
Xylophylla is so well known for these plants; we have thought it more safe
to give the Genus those characters the plants bear under their true Class and
Order, than make any alteration in it. The Xylophylla falcata is a native of
the West India Islands, and has been long cultivated in our hot-houses; so
long ago as the year 1739. It is a tender plant, and will not flower without the
assistance of the bark-bed; is easily propagated by cuttings; grows best in
sandy peat, and flowers in August. Our drawing was made at the
Hammersmith Nursery.