Introducing Algorithms In C A Step By Step Guide To Algorithms In C 1st Ed Luciano Manelli pdf download
Introducing Algorithms In C A Step By Step Guide To Algorithms In C 1st Ed Luciano Manelli pdf download
https://ebookbell.com/product/introducing-algorithms-in-c-a-step-
by-step-guide-to-algorithms-in-c-1st-ed-luciano-manelli-55547098
https://ebookbell.com/product/introducing-algorithms-in-c-a-step-by-
step-guide-to-algorithms-in-c-luciano-manelli-11074058
https://ebookbell.com/product/fundamentals-of-cryptography-
introducing-mathematical-and-algorithmic-foundations-undergraduate-
topics-in-computer-science-1st-ed-2021-duncan-buell-32792596
https://ebookbell.com/product/introducing-islam-a-graphic-guide-
graphic-guides-2nd-revised-edition-2nd-ziauddin-sardar-48359932
https://ebookbell.com/product/introducing-comparative-politics-5th-
edition-stephen-walter-orvis-44864186
Introducing Financial Mathematics Theory Binomial Models And
Applications Chapman And Hallcrc Financial Mathematics Series 1st
Edition Mladen Victor Wickerhauser
https://ebookbell.com/product/introducing-financial-mathematics-
theory-binomial-models-and-applications-chapman-and-hallcrc-financial-
mathematics-series-1st-edition-mladen-victor-wickerhauser-44875460
https://ebookbell.com/product/introducing-anthropology-laura-pountney-
tomislav-maric-46096168
https://ebookbell.com/product/introducing-philosophy-for-canadians-a-
text-with-integrative-readings-1st-edition-robert-c-solomon-46248138
https://ebookbell.com/product/introducing-bronfenbrenner-a-guide-for-
practitioners-and-students-in-early-years-education-2nd-edition-nirn-
hayes-46496164
https://ebookbell.com/product/introducing-micronaut-build-test-and-
deploy-java-microservices-on-oracle-cloud-1st-edition-todd-raymond-
sharp-46518710
Introducing
Algorithms in C
A Step by Step Guide to
Algorithms in C
—
Luciano Manelli
Introducing
Algorithms in C
A Step by Step Guide
to Algorithms in C
Luciano Manelli
Introducing Algorithms in C: A Step by Step Guide to Algorithms in C
Luciano Manelli
Taranto, Italy
To my son, Marco
To my mum, Anna
Table of Contents
About the Author���������������������������������������������������������������������������������ix
About the Technical Reviewer�������������������������������������������������������������xi
Introduction���������������������������������������������������������������������������������������xiii
v
Table of Contents
The Algorithms����������������������������������������������������������������������������������������������������24
Sum of Three Numbers����������������������������������������������������������������������������������24
Sum of n Numbers in a Loop�������������������������������������������������������������������������25
Storing Numbers Within an Array������������������������������������������������������������������27
Array Exercise�����������������������������������������������������������������������������������������������30
Converting a Decimal Number to a Binary Number���������������������������������������32
Maximum/Minimum Search��������������������������������������������������������������������������36
Searching Problem����������������������������������������������������������������������������������������38
Sorting Problem���������������������������������������������������������������������������������������������46
Merging of Two Sorted Arrays�����������������������������������������������������������������������55
Reading Chars from a Text File����������������������������������������������������������������������58
Functions and Subprograms�������������������������������������������������������������������������59
Recursion������������������������������������������������������������������������������������������������������63
vi
Table of Contents
Index�������������������������������������������������������������������������������������������������143
vii
About the Author
Luciano Manelli was born in Taranto (Italy),
where he currently resides with his family.
He graduated in electronic engineering at the
Polytechnic of Bari at 24 years of age, and then
he served as an officer in the Navy. In 2012, he
received a PhD in computer science from the
Department of Informatics, University of Bari
Aldo Moro.
He is a contract professor at the
Polytechnic of Bari and at the University of Bari Aldo Moro. He is a
professionally certified engineer, an innovation manager, and the author
of several IT technical books for different publishers. In 2014 he started
working for the Port Network Authority of the Ionian Sea – Port of Taranto,
after working for 13 years for InfoCamere SCpA as a software developer.
You can find out more at his LinkedIn page: it.linkedin.com/in/
lucianomanelli.
ix
About the Technical Reviewer
Michael Thomas has worked in software
development for more than 20 years as an
individual contributor, team lead, program
manager, and vice president of engineering.
Michael has more than 10 years of experience
working with mobile devices. His current focus
is in the medical sector, using mobile devices
to accelerate information transfer between
patients and healthcare providers.
xi
Introduction
This book serves as a starting point for anyone who is beginning their
study of computer science and information systems. Algorithms play
an important role in programming, and they can be considered the
cornerstone of computer science, because computer programs would
not exist without algorithms. In fact, understanding a problem and
getting a solution is a fundamental condition for software development
and problem-solving strategies. Therefore, the aim of this book is to
explain algorithms in different ways and then teach you how to analyze
new algorithms. In this book, we will use the C language to verify the
correctness of the algorithms.
Chapter 1 introduces data types (simple and structured), and
Chapter 2 defines the algorithms and flowcharts with graphical and
textual explanations. We’ll look at simple and complex standard
algorithms, as well as their flowcharts. Everything is integrated with
explanations, schemas, and tables to show the step-by-step evolution of
the algorithms.
The main analyzed algorithms are the following: the sum of three or n
numbers in a loop, the decimal to binary conversion, the maximum and
minimum search, the linear/sequential search, the binary search, the
bubble sort, the selection sort, the merging of two sorted arrays, and the
reading chars from file algorithm, stack management, and the recursive
algorithm (factorial and Fibonacci sequence).
The last chapter is devoted to the introduction of the C language and
the implementation of code related to the algorithms in this book. Many C
programs are explained.
xiii
CHAPTER 1
Data Structures
The study of algorithms is connected to data structures. A data structure
is a way to store data to facilitate organization and modifications. Every
data structure is used for a specific purpose, so it is important to know the
characteristics of several of them so you can choose the data structures
that are appropriate for the operations performed by an algorithm.
V
ariables and Constants
A variable represents a memory location that stores an assigned value.
Each variable is associated with a data type and stores one or some values.
Variables can change their value during program execution, but they
cannot change their structure or their data type. A variable is characterized
by three elements.
a=4;
b=5;
a==b;
SUM = a+b;
2
Chapter 1 Data Structures
i = i + 1;
3
Chapter 1 Data Structures
Reading the formula from left to right, the first index i indicates the
new value of the counter, the second variable indicates the value currently
stored in the counter i, and the third variable indicates a new value (1) that
has to be added to the current variable i.
Constants are similar to variables, but they cannot change their value
during program execution. They also usually have a different type of
declaration in the program. For example, if we wanted to assign an integer
value (4) to the constant const in the C language, we would write the
following:
#define CONST = 4
Primitive Types
It is possible to define the following primitive types:
4
Chapter 1 Data Structures
Structured Types
To represent data in other ways, it is possible to define structured types.
The following are the basic structuring methods presented in this chapter:
• Array
• Linked list
• Queue
• Stack
• Graph
• Tree
• Hash table
• Record
• File
Array
One of the most important elementary data structures is the array. An
array is a sequence of n items of the same data type stored contiguously
in computer memory. An array is accessible by specifying a value of the
array’s index (an integer between 0 and n – 1, where n is the length of the
array).
So, an array is characterized by the following:
• Length (n)
5
Chapter 1 Data Structures
For example, to create an array a of six integer elements (4, 1, 34, 56, 7, 0),
we would write the following:
a (0) = 4;
a (1) = 1;
a (2) = 34;
a (3) = 56;
a (4) = 7;
a (5) = 0;
4 1 34 56 7 0
Linked Lists
Another important elementary data structure is the linked list (a one-
dimensional, or singly linked, list). A linked list is a data structure in which
the elements are arranged in a sequence of zero or more elements called
nodes. Each element contains two kinds of information.
6
Random documents with unrelated
content Scribd suggests to you:
But with all their distinguished merits in these branches of poetic
literature, they laid no claims to recognition, nor shall we claim it for
them. Their aspiration was higher. Their lay was sacred. Their ideal
of poetic grandeur was the writing and singing of majestic hymns,
and they have given us a hymnology, a collection of pure and sacred
songs, that has never yet been equalled. We know not what rational
religious fervor is, we know not what real piety is, we know not what
joyful ectasy is, nor what tearful and penitent tenderness means, we
know not what trust in, and love of God is, we know not what it is to
hear the heart speak to and of God, and the soul sing her Maker's
praise, we know not what passionate devotion to, and deathless love
for, Israel's cause, for the memory of her glorious past and for the
hopes of her future is, we know not what all these are and mean,
until we have read some of the hymns and sacred odes and elegies
and meditations of the Jewish poets of Spain. Turn to your "Day of
Atonement" services; read there the inexpressibly beautiful
contributions to sacred poetic literature by Rabbi Solomon ben
Jehuda Gabirol, or Rabbi Joseph ben Ibn Abitur, or Rabbi Bechai ben
Joseph, or Rabbi Moses ben Esra, or the greatest of them all Rabbi
Jehuda ben Samuel Ha-Levi, and answer it, where have you seen
and where have you read or heard, anything that will bear
comparison, with their religious poetry? Let us see the following
from Gabirol:
MEDITATIONS.
Forget thine anguish,
Vexed heart, again,
Why should'st thou languish,
With earthly pain?
The husk shall slumber,
Bedded in clay,
Silent and sombre,
Oblivion's prey!
But, Spirit immortal,
Thou at Death's portal,
Tremblest with fear.
If he caress thee,
Curse thee or bless thee,
Thou must draw near,
From him the worth of thy works to hear.
Life is a vine-branch;
A vintager, death.
He threatens and lowers
More near with each breath.
Then hasten, arise!
Seek God, oh my soul!
For time quickly flies,
Still far is the goal.
Vain heart praying dumbly,
Learn to prize humbly,
The meanest of fare.
Forget all thy sorrow,
Behold, Death is there!
Dove-like lamenting,
Be full of repenting,
Lift vision supernal
To raptures eternal.
On every occasion
Seek lasting salvation.
Pour out thy heart in weeping,
While others are sleeping.
Pray to Him when all's still,
Performing His will.
And so shall the angel of peace be thy warden,
And guide thee at last to the heavenly garden.
HYMN.
Almighty! what is man?
But flesh and blood.
Like shadows flee his days,
He marks not how they vanish from his gaze.
Suddenly, he must die—
He droppeth, stunned, into nonentity.
IN THE NIGHT.
Unto the house of prayer my spirit yearns,
Unto the sources of her beings turns,
To where the sacred light of heaven burns,
She struggles thitherward by day and night.
Read the following stanzas culled from Ha-Levi's "Elegy on Zion" and
ask yourselves, where is the sacred epic that will compare with it?
ON THE VOYAGE TO JERUSALEM.
I.
II.
II.
III.
IV.
V.
We must devote some little space and time to a review of the place
the Moors and the Jews held in philosophy during their stay in Spain
from the eighth to the fifteenth century. The purpose of this work
makes this review necessary. Not that we shall see any wonderful
advance in this department of learning, nor that we need show the
glaring contrast between the sophistical cobwebs of the
cotemporaneous scholastics and the rational researches of the
Moorish and Jewish philosophers, but that we may see what a debt
of gratitude modern philosophy owes the Jew and Moor, for taking
up the thread of philosophical research where Greek intelligence had
been forced to leave it, and for carrying it forward sufficiently for
modern philosophy to build upon it, as a superstructure, the theories
and systems of to-day.
To fully understand their place in philosophy it is necessary for us to
retrace our steps in history some 2,000 years, and enter the city of
Alexandria. Here Alexander the Great had established his seat of
government. It became the intellectual metropolis of the world.
Thither the conqueror brought the wealth and learning of the globe.
Into that city the people streamed, or were brought as prisoners,
from the remotest corners of the known world, from the Danube to
the Nile, and from the Nile to the Ganges. For the first time in the
world's history, there could be found in one city, men who could
speak learnedly of the Borean blasts of the countries beyond the
Black Sea, and of the simoons of the Oriental deserts, of pyramids
and obelisks and sphinxes and hieroglyphics, of the Persian and
Assyrian and Babylonian wonders, of the Chaldean astronomers, of
hanging gardens, aqueducts, hydraulic machinery, tunnels under the
river-bed, or of the Assyrian method of printing, on plastic clay. For
the first time in the world's history seekers after knowledge could
listen, in the Serapion of Alexandria, to learned discussions between
Jewish monotheists and Persian dualists and Grecian polytheists and
Egyptian mysticists and Indian Brahmanists and Buddhists, and
between the Ionics and Pythagoreans, and Eleatics and the Atomists
and Anaxagoreans, and the Socratists, and Platonists and
Aristotelians and Stoics and Epicureans and Neo-Platonists. No age
or city had ever furnished better opportunities for intellectual
pursuits. No city could ever before this, point to kings more
enthusiastic for the promotion of learning than were her Ptolemys,
nor could all antiquity boast of a library equal to hers, or of a
museum as justly celebrated for its botanical gardens and
astronomical observatories and anatomical college and chemical
laboratory.
A prodigious stimulus was thus given to learning, and it has left its
impress upon the world's civilization. Here Euclid wrote the theorems
which are still studied by the college students of to day. Here
Archimedes studied mathematics under Conon. Here Eratosthones
made astronomy a science. Here Ptolemy wrote his "Syntaxes." Here
Ctesibius and Hero invented the steam engine. Here true philosophy
flourished, and for the first time, too, in the world's history. The
people of the Orient had dabbled in speculative thought before this,
but the results achieved showed that the Oriental mind is not
adapted to abstract reasoning. The luxurious habits and voluptuous
surroundings and tropical climate of the Orient tend more toward
poetry, music and love and languor than toward psychical
contemplations. The awe-awakening phenomena of nature, which
confront the Oriental everywhere, naturally lead him to accept as a
priori principles what the philosophers of the Occident make the
subject of endless, and for the most part, incomprehensible and
unsatisfactory systems of philosophy.
It is for this reason that the great religions of the world sprang from
Oriental soil, while the great philosophical systems took roots in
Western lands. Yet, up to this period, not even the West, with all its
labors, had sounded the depths of true philosophy. The entire pre-
Socratic philosophy wasted its energies upon the futile effort to find
some principle for the explanation of nature, which to the Hebrew
mind had been solved thousands of years before in the opening
verse of the Bible. One thought it to be water; another, air; and a
third an original chaotic matter. The Pythagoreans declared that
number is the essence of all things, and the Eleatics believed they
were nearer the truth by negating all division in space and time. The
Atomists endowed each atom with gravity and motion, and
accounted thus for the origin of all physical existences and states.
Socrates and Plato both came much nearer to the solution of the
problem; the former postulated self-knowledge as the starting point
of all philosophy, and the latter combined all preceding systems into
one scheme, with an infinitely wise and just and powerful spirit as its
guiding principle, but idealistically only. The additional realistic view
of things had not yet been reached, and could not be reached, for
that depends upon universal and exact and scientific knowledge,
which prior to the great age of Alexandrian learning, to which all
ages and climes and nations contributed their experiences and
observation and knowledge, had never yet existed. Aristotle, the
teacher of Alexander, and the friend of Ptolemy, thus found through
Alexandrian influence, opportunities for philosophical reasoning,
which necessarily gave his system an almost inestimable advantage
over his predecessors. From the study of particulars he rose to a
knowledge of universals, advancing to them by induction. This
inductive method was grounded upon facts of his own experience
and observation, as well as those of others, whom the intellectual
metropolis had sent into Greece. He became the first and best
absolute empiricist. His system acquired an encyclopedic character.
He became the father of logic, natural history, empirical psychology
and the science of rights. Aristotelian philosophy became the
intellectual corner stone on which the Museum rested, and is to-day,
through Jewish and Moorish influence, as we shall presently see, the
corner stone of modern philosophy.
The Jewish community of Alexandria was very large. When
Alexander founded this city and gave it his name, he wished to
secure for it permanent success, and so he brought them thither by
the thousands. Ptolemy brought 100,000 more, after his siege of
Jerusalem, and Philadelphus, his successor, redeemed from slavery
198,000 Jews, "paying their Egyptian owners a just money
equivalent for each." Alexander's expectations were realized; the city
of his name led the world in commerce and intellect. With an
enthusiasm almost bordering on passion the Hebrews devoted
themselves to philosophy, especially to Aristotelian philosophy. They
ingrafted it upon their own theology and philosophic speculations,
some going even so far as to believe that Aristotle must have been a
Jew himself.
Henceforth Aristotelian philosophy is Jewish philosophy. The
occasional acceptance of the Neo-Platonic mysticism, theosophy and
theurgy, was unable to obliterate it.
During seven centuries learning flourished in the city of Alexandria,
zealously fostered by native Egyptian, Greek and Jew. A new power
arose—Christianity. At once it recognized in Aristotelian philosophy
an inimical foe, and began its work of suppressing rational research
and free thought. The rest we need not relate. We know what
happens when Christianity institutes inquisitors of faith instead of
inquirers of learning. We know what happens when Christianity uses
power instead of argument. That day, when the beautiful and young
Hypatia, perhaps, the most accomplished woman that has ever lived,
the popular lecturer of Platonic and Aristotelian philosophy at the
Museum, where her lecture room was crowded daily, with the wealth
and intellect of Alexandria; that day, when this most noble of women
was assaulted by Bishop Cyril's fanatical and blood-thirsty monks,
when she was dragged by the followers of the "religion of love,"
from her chariot, stripped naked in the street, pulled into the church,
where she was cut to pieces—where her flesh was scraped from the
bones with a shell and the remnants cast into fire; that day marked
the extinction of Alexandrian learning—it marked the extinction of
Athenian learning. Science, so successful, died the death of
strangulation, and the expounders of Aristotelian philosophy were
silenced, and their literature condemned to the pyre.
But Aristotelian philosophy was not yet dead. The Jews still lived,
and with them the works of Aristotle. They had succeeded in
concealing translations and original copies of his works from the
fanatical champions of ignorance. They had absorbed it into their
system of thought. They had used it in their commentaries upon
their Scriptures. They had saturated their very prayers with it. They
had sought to reconcile Jewish theology with refined heathen
philosophy. Whither they wandered, it wandered, and where they
were permitted to study there also was Aristotelian philosophy
studied. What they had long wished was granted them at last. They
became the restorers of philosophy in Europe. Moorish and Spanish
prosperity afforded them the opportunities for an uninterrupted
study and development of the Aristotelian philosophy. Soon the Moor
shared their enthusiasm. The caliphs sent special messengers to
secure whatever of Aristotelian philosophy had escaped the mob of
"St. Cyril."[32]
Many were they, both Jews and Moors, who devoted themselves to
this philosophy, and vast the systems they unfolded. The wonderful
advance they had made in the sciences, and in the other branches of
learning, enabled them to enlarge upon the teachings of Aristotle.
New facts and new experiences and new observations led them to
new and advanced inductions. However great the temptations be to
enter into some analysis of their philosophical system, we must not
yield to them; that is not the object of this review. Our design is to
show what influence Moorish and Jewish learning exercised upon
European civilization. We have seen its impress upon the sciences
and literatures of Europe, and its impress is visible still on modern
philosophy.[33] From all parts of the world persons having a taste for
philosophy found their way to the Moorish and Jewish sages of
Spain. Gerbet himself, later Pope Sylvester II., had repaired to
Cordova and Seville to hear Moorish and Jewish philosophers
expound the mysteries of wisdom and philosophy, and so illustrious
an example soon became the raging fashion among European
scholars. As if desirous of dividing the honors equally, both the
Moors and the Jews sent at the same time, a representative
champion into the philosophical arena who, by their united labors,
not only demolished scholasticism but also laid the permanent
foundation of modern philosophy. The representative philosopher of
the Moors was the great Averroes (Ibn Roshd, 1149-1198) whose
name still occupies an honored place upon the pages of history of
philosophy, and whose system, bearing his name—Averroism—is still
recognized among the philosophical systems of the world. The
representative Jewish philosopher was the great Moses Maimonides,
(1135-1204) the greatest Jewish philosopher the Jews have ever
produced, and one of the greatest the world has seen to this day,
whose philosophical system, unfolded in his "More Nebuchim,"
("Guide for the Perplexed") still remains truly, grandly immortal.
For several centuries the Moorish and Jewish philosophy was the
delight of such men in whom Spanish learning kindled a desire for
deeper research and loftier thought than Europe had hitherto
offered. Even many of the schoolmen shared this enthusiasm. But
this very enthusiasm was the deathblow to scholasticism. Once
imbued with Moorish and Jewish empirical philosophy and inductive
reasoning, the rational mind could no longer pursue the sophistic
teachings which the church held up as the divine wisdom. That
philosophy shook the old faith to its very root, produced new
predispositions and prepared the way for the coming change. It
weaned men from simply believing the church's "say-so" and taught
them to think, and when men began to think scholasticism ceased,
and the Reformation began, and with it modern thought. No longer
would the rational mind believe that legends and miracles can decide
such questions as are the starting point of philosophic thought. No
longer would they endure the preposterous teaching—the product of
ignorance and audacity—that the faith of the church is absolute
truth; that faith is greater than knowledge; that a thing may be
theologically true even though it be philosophically false. No longer
would they disgrace themselves with continuing to waste time and
parchment with discussions and treatises such as these, to which the
schoolmen of several centuries devoted hundreds of volumes: "How
many choirs of angels are there in heaven, how do they sit and upon
what instrument do they play?" "To what temperature does the heat
rise in hell?" "Wherein lies the difference between 'consubstantiatio
and transubstantiato'?" "What kind of feathers had the angel Gabriel
in his wings? What kind of a swallow it was that caused Tobias'
blindness? Whether Pilate washed his hands with soap before he
condemned Jesus? Whether it was an adagio or allegro which David
played before Saul? What sort of salve it was which Mary brought to
the Lord? Whether the coat for which the soldiers cast lots
constituted the entire raiment of the Redeemer? Whether the valley
of Jehosophat is large enough for the world's judgment day?" and so
on ad nauseam. A schism arose. The indignation of St. Thomas
Aquinas, the leader of the Dominicans, knew no bounds when he
beheld Christians drinking in, in full draughts, Moorish and Jewish
philosophy. The Franciscans opposed him and every effort of his to
suppress their writings. The conflict lasted till 1512, when the
Lateran council condemned "the abettors of these detestable
doctrines to be held as heretics and infidels," and the Dominicans,
armed with the weapons of the Inquisition, were not slow to silence
Averoism in Europe.
But though silenced it lived in Jewish philosophy, and that, as little
as its Talmud and Bible no power on earth has ever been strong
enough to silence. Though silenced, with the aid of the Jews it
flashed forth to all parts of Europe, where it found its way as readily
into the "Opus Majus" of Roger Bacon as into the curriculum of
studies of the University of Padua. Though silenced, it permeated
the Renaissance. Though silenced, it formed the groundwork of
Spinoza's system. Though silenced, with the aid of the Jewish
philosophers, who laughed the Inquisition to scorn, it was studied
everywhere, and everywhere it assumed those gigantic proportions
destined to illumine the intellect of Europe. Though silenced, with
the aid of the Jewish philosophy, it ushered in modern philosophy
and the civilization of to-day.
CHAPTER. XIV.
IN THE INDUSTRIES.
Hark! Again the doleful knell is tolling. With greater speed and in
larger numbers the people are hurrying to the public square. The
procession of priests, chanting hymns of victory and imprecatory
prayers, is starting towards the auto-da-fe. The victims supplicate for
death more piteously than before. Hark! Again, and with greater
alarm, the agonized voice of civilization calls unto us: Haste ye, the
furnaces are heated! The pyres are prepared! The massive gates of
the gloomy inquisition dungeons are open. The instruments of
torture are ready for the cruel work of death. Haste ye, the moments
are few, gather whatever knowledge there still remains to be
collected concerning the wondrous achievements of the Jew and
Moor, as speedily as you can; tarry, and flame and sword and rack
and expulsion will hurl all knowledge of it into oblivion forever!
Let us heed the warning and briefly state what yet remains to be
told. You have 'ere this surmised what we are about to prove, the
imperishable monuments which the Moors and Jews have erected to
their name and fame in the arts and sciences, in literature and
philosophy bear witness, not only to their great intellectual wealth,
but also to vast material possessions. Wherever learning is zealously
fostered there wealth exists, and where wealth abounds, there
agriculture and commerce and industry must have had prior
existence.
Thus it was in Moorish Spain. Never before, nor ever since, did Spain
enjoy a prosperity equal to that which blessed her lands, when
Moorish and Jewish skill and diligence and enterprise made her, in
glaring contrast with the rest of Europe, the granary and the
industrial and the commercial center of the world. We have not yet
forgotten how, when in the introductory chapters of this volume, we
thought ourselves back some eight or ten centuries in the world's
history, and hastened across the wild Atlantic to learn of the
condition of Europe and her people, how spell-bound we stood, as
we suddenly beheld wonders and beauties in Spain, scarcely
equalled to-day in all Europe. And when we reflected upon the
present condition of Spain, among the poorest of all European
countries, its people proverbially indolent and ignorant, we had to
assure ourselves, again and again, that it was Spain, indeed, which
suddenly disclosed to us these unexpected, and still unequalled,
proofs of industry and learning and cultured taste. Nor have we yet
forgotten, when gliding upon the majestic Guadalquivir along fertile
valleys, and luxuriant fields and graceful groves, and fragrant parks,
and glittering palaces, and busy factories, and restless mines, we
passed out of Spain, and visited the other countries of Europe how
dreary and wretched and appalling the scenes were which met our
gaze everywhere. Scarcely a city anywhere. Nothing that could, even
with the broadest stretch of leniency, be designated as agriculture.
Everywhere pathless deserts and howling wastes, and death-
exhaling swamps. Wretched, windowless and chimneyless and
floorless hovels sheltered man and beast under the same roof.
Everywhere men with squalid beards, and women with hair unkempt
and matted with filth, and both clothed in garments of untanned
skin, that were kept on the body till they dropped in pieces of
themselves, a loathsome mass of vermin, stench and rags.
Everywhere beans and vetches and roots and bark of trees and
horseflesh furnished largely the means of supporting life. Nowhere
even a trace or semblance of industry. Everywhere the word
commerce an unintelligible term. Such was the condition of the rest
of Europe when Spain was basking in the sunshine of a most
wonderful state of prosperity under the skill and enterprise of the
Jew and the Moor.
From the very first both directed their attention to agriculture. The
fertile valleys and the luxuriant fields, and the vine-clad hills, and the
fruitful orchards, and the flowry meads and the sweet-scented
pasture lands of Palestine bear eloquent testimony to Jewish skill in
agriculture. The advice which the prophet Jeremiah had sent to the
Jewish captives of Babylon: "Build ye houses, and dwell in them, and
plant gardens and eat the fruits of them, ... and increase in your
captivity and not diminish. Seek the welfare of the city whither you
are carried as captives, and pray unto the Lord for it; for in the
welfare thereof shall ye prosper and have peace."[34] This excellent
advice the Jews applied to themselves, and faithfully followed,
wherever they lived in exile, and wherever they were suffered to
dwell in peace and promote the country's welfare. The Arab-Moors
were no less devoted to this noble pursuit. When their warfare was
over they beat their swords into plowshares, and their spears into
pruning knives. Their motto was: "He who planteth and soweth, and
maketh the earth bring forth fruit for man and beast, hath done
alms that shall be reckoned to him in heaven." These two races
devoted themselves to the cultivation of Spain with their hereditary
love for the occupation, and with the skillful application of the
experience, which they had gathered in other lands where they had
dwelled or where they had established their power. By them
agriculture in Spain was carried to a height, which until the invention
of machinery was not surpassed in Europe. As early as the tenth
century the revenue of agriculture of Moorish Spain alone amounted
to nearly $6,000,000, more than the entire revenue of all the rest of
Europe at that time. The ruins of their noble works for the irrigation
of the soil, their great treaties on irrigation and crops, and improved
breeds of cattle, on grafting and gardening, and their code of laws
regulating agriculture, which still exist, still attest their skill and
industry and put to shame the ignorance and indolence of their
Spanish successors. Many plants were introduced in Europe, and
successfully cultivated by them, which, after the expulsion of the
Jews and Moors, and the discovery of America, Spain lost and
neglected, such as rice and sugar cane (soukhar), as they called it,
saffron and mulberry trees, ginger, myrrh, bananas and dates. The
Spanish names of many plants show their origin, and some have
traveled even to us, such as the apricot, from "albaric aque," the
artichoke from "alca chofa" cotton from "al godon."[35] They gave
Xeres and Malaga their celebrated wine, which has maintained its
reputation to this day.
The mining industries, too, were zealously fostered by them. Spain
was and is a widely metalliferous country. Her hidden treasures were
known already to the Phœnicians, Carthagenians and Romans, and
were mined by them with great profit. The gold and silver of
Solomon's temple come through Hiram of Tyre from Tarshish, which
was Southern Spain. But the dark ages had set in and with them
Europe's universal sloth. When the Moors entered Spain the ancient
mines had been, for the most part, abandoned. They revived this
industry, and with a zeal which may best be told by the existence to-
day of 5,000 Moorish shafts—distinguished from the former by being
square instead of round—in one district (Jaen) alone gold was found
in large quantities, and it was one of their leading articles for
manufacture and export. They gave us the Arabic word "carat"
which we still use in speaking of the quality of gold. They opened
the inexhaustible vein of mercury which they worked with great
profit and with such skill, that it still forms the largest deposit in the
world, yielding still one-half of the quicksilver now in use, and being
a government monopoly, this one remnant of Moorish and Jewish
skill and industry, alone, still produces an annual revenue of
$1,250,000. In addition to these, lead, copper, iron, alum, red and
yellow ochre were mined in great quantity. Precious stones also were
in great abundance—the beryl, ruby, golden marcasite, agates,
garnets. Pearls were found on the coast near Barcelona. Building
stones, marbles, and jaspers of all colors, were uninterruptedly
quarried in the mountains.
The manufacturing industries kept pace in their success with that of
mining and agriculture. With the Jews a knowledge of silk culture
came into Europe, and with the assistance of Moorish skill it became
one of the leading industries and one of the most profitable exports.
All Europe, and the greater portions of Asia and Africa, looked to the
Jews and Moors of Spain for their fine fabrics of silk and cotton and
woolen, for all the wonders of the loom and the skilful and delicate
patterns of filigree work in gold and silver. The carpet manufacture
of the Moslems reached the excellence which it has maintained to
our own day.
They made glass out of a silicious clay and used it for fashioning
vessels, and also in glazing those beautiful tiles—for which Valencia
is still famous—called azulejos, which they employed in embelishing
floors and wainscoting. The best leather was made by the Jews and
Arab-Moors in Cordova, and hence Spanish leather is still called
Cordovan, which has given to English shoemakers their name of
"Cordwainers." The still celebrated "Morocco" leather—the secret of
its manufacture having been carried to Morocco, after their expulsion
from Spain,—speaks to this day of Moorish and Jewish skill in this
branch of industry. The "Toledo Blade," famous in the past and
famous still, the invention of, and the plentiful and lucrative
manufacture of cotton and linen paper, that blessed boon to
civilization, which alone made the printing press possible and
beneficial, the introduction of gunpowder and artillery, of the magnet
and the mariner's compass, of mechanical and scientific apparatus
and instruments, these and many more still speak in eloquent terms
of Moorish and Jewish industry in Spain, and, more eloquently still,
they tell the tale of Spanish ingratitude.[36]
This diligence and success in agriculture and in the industries made
commerce necessarily very active and lucrative. The ports swarmed
with vessels of traffic. The Jews and Moors of Spain maintained a
merchant marine of thousands of ships. They had their factories and
warehouses and consuls in all centers of industry. Their exports were
very large.
The Jews, who had been compelled to wander the wide world over
had acquired a most perfect geographical knowledge, which was
serviceable to them now. It was through them that the existence of
the Cape of Good Hope was made known in Europe. It was through
Averroes that the attention of Columbus was drawn to his subject of
finding a short route to the Indies. Their commerce opened the tide
of discovery by navigation. Moorish and Jewish industry sought
foreign markets and found them, too, from the Azores to the interior
of China, from the Baltic to the coast of Mozambique, and eventually
from the kingdom of Granada to the new world. Granada, especially
in the words of the historian, became the common city of all nations.
The reputation of its citizens for trustworthiness was such that their
bare word was more relied on than a written contract is now among
us, to which a Catholic bishop adds: "Moorish integrity is all that is
necessary to make a good Christian."[37]
The position of the Moors and Jews of Spain in the industries may,
therefore, be briefly summarized thus, a prosperous state of
commerce arose never known before, and in the southern part of
Europe never equalled since. Farther and farther this commerce
pushed its interests, and more and more busy became the industries
at home, and greater and greater grew their opulence. Gradually the
rest of Europe awakened from its lethargy. Moorish and Jewish toil
infused life and ambition into its people. Italy, Portugal, France and
England began to compete. New markets became necessary. New
discoveries followed, and with the general activity and prosperity
Welcome to our website – the perfect destination for book lovers and
knowledge seekers. We believe that every book holds a new world,
offering opportunities for learning, discovery, and personal growth.
That’s why we are dedicated to bringing you a diverse collection of
books, ranging from classic literature and specialized publications to
self-development guides and children's books.
ebookbell.com