Professional Documents
Culture Documents
Cormen, Charles E
Chapter 2 overview
Goals
Start using frameworks for describing and analyzing algorithms.
Examine two algorithms for sorting: insertion sort and merge
sort. See how to describe algorithms in pseudocode.
Begin using asymptotic notation to express running-time analysis.
Learn the technique of “divide and conquer” in the context of merge sort.
Insertion sort
The sorting
problem
Expressing
algorithms
Pseudocode is similar to C, C++, Pascal, and Java. If you know any of these
languages, you should be able to understand pseudocode.
Pseudocode is designed for expressing algorithms to humans. Software
en- gineering issues of data abstraction, modularity, and error handling are
often ignored.
We sometimes embed English statements into pseudocode. Therefore, unlike
for “real” programming languages, we cannot create a compiler that translates
pseudocode to machine code.
Insertion sort
Pseudocode
We use a procedure I NSERTION -S ORT.
Takes as parameters an array and the length of the
array. As in Pascal, we use “ ” to denote a range within an array.
length
length
The array is sorted in place: the numbers are rearranged within the
array, with at most a constant number outside the array at any time.
Another random document
un-related content on Scribd:
become a spiritual centre for the still dispersed communities of Israel, and
destined, let us hope, to influence and elevate the mental life, social
aspirations and religious conceptions of the Jews of the world.
¹ “Blessed art Thou O! Lord our God, King of the Universe who hast preserved
us alive, and sustained us and brought us to (enjoy) this season.”
Dr. Weizmann then read the following message from Mr. Balfour:—
“Please accept my cordial good wishes for the future of the Hebrew
University on Mount Scopus. May it carry out its noble purpose with ever-
increasing success as the years go on. I offer my warm congratulations to all
who have laboured so assiduously to found this school of learning, which
should be an addition to the forces of progress throughout the world.”
The whole ceremony was a deeply moving one, and produced an effect
which will long remain with those who witnessed it.
The work of the Commission was made possible by the work of the
British Army and its scope was greatly increased by General Allenby’s
complete conquest of the country. In September, 1918, General Allenby
secured a victory which resounded throughout the world by its
completeness as well as by its brilliance. By most skilful procedure the
Turkish line was broken in several places and Nablus and Beisan were
captured. The bridge of the Daughters of Jacob over the Jordan was seized
and British troops wheeling round by quick marches along the coastal plain,
passed through the defile of Megiddo and cut off the greater portion of the
Turkish army. The strong Turkish positions in the hills about Nablus were
surrounded and positions which if directly attacked would have cost
thousands of lives were taken with comparatively few losses.
This mighty war has now come to an end and the world breathes freely
once more. The cruelties and horrors of more than four years seem now like
a nightmare. That nightmare has vanished—let us hope for ever. Day has
dawned again, a day of victory, whose power for good outweighs the evil
powers let loose by the world-war. The great armies of the Western Allies
and of the United States of America have been victorious. In consequence
of this victory an old world order has been destroyed and a new and a better
one brought into being. State organizations which had forced diverse
nations into their artificial and incongruous structures only by power are
collapsing like houses of cards. Those who ruled by the sword perished by
the sword. Despotism, supported by militarism, is shattered. The victory of
the Allies ought to be more than a victory of one group of states over
another; this ought to be the victory of what is good in man over what is
evil. This victory must benefit the conquered not less than the conquerors.
One great idea has been victorious in this war, namely, the national
principle: liberty, equality, and self-determination of all peoples, great and
small, old and young. Every nation has the right to live, given the will to do
so. Every nation has a right to the land in which it grew to be a nation. It is
all one, whether this was accomplished a hundred years ago as in Belgium,
or many hundreds of years ago as in Armenia, or as in Greece some
thousands of years ago. The right of a people to its historical home cannot
be limited by time.
For this ideal seven millions of men, the vigorous youth of mankind,
have sacrificed their lives, and many millions more have been crippled. For
this ideal of justice several countries have been laid waste and civilization
itself has been threatened with complete destruction. This great ideal of
justice, however, will be worthy of the terrible sacrifices which have been
made; it must now be attained.
A new Europe and—a new Asia. Light is shining again from the East.
The glorious British Army has reconquered ancient East for civilization.
The Arabs, our Semitic kindred, the descendants of a chivalrous and one-
time famous race, side by side with inspired Jewish volunteer forces who
had flocked together to fight with love and enthusiasm for the Land of
Promise, have, with the assistance of French and Italian reinforcements,
done their duty in assisting the British Army. Mesopotamia, Arabia, Syria,
and Palestine are now freed for their nations. An Arabian Kingdom, a free,
well-ordered Syria, the remnants of the unfortunate, hard-tried Armenian
nation established as an Armenian State, and a new Erez Israel, all these
will have to be created on a basis of historical rights and of the realization
of the national principle, each under the protection of, and receiving
assistance from, some suitable Great Power, in accordance with their own
desire, in their gradual and peaceful progress towards their ultimate goal.
What, we ask, will now be the position of the Jews at this juncture?
What will the great victory bring to this people who have been so hard hit
by this war? Hundreds of thousands of Jews have lost their lives, most of
them in countries where they had no share in human rights, and nothing to
fight for. Dying on the Carpathian mountains or in the plains of Moldavia,
the last glance of their closing eyes was turned to the East, to the hills of
Zion. Innumerable masses have been maimed, millions nerve-shattered and
starved out, tens of thousands of Jewish homes, thousands of old Jewish
communities wiped out, never to be reconstructed. Will all this not be taken
into account in the general reckoning of the great victory? Jews live in
larger or smaller numbers in different countries, where they are faithful and
devoted citizens. The majority of the Jewish people have suffered too long
and too bitterly in many countries, and it must be the task of the nations and
their governments, once and for all, to put an end to these unspeakable
sufferings in the old states and in those soon to be founded, by solemn
declarations and binding obligations. The Jews desire to be emancipated,
that is, released from servile tutelage; in a free state they do not wish to be
the only pariahs and slaves. They demand to be free; that means in the first
place that they want to breathe freely, to breathe wherever they wish
without fear that a policeman or a neighbour should point out to them that a
Jew may not breathe everywhere. They demand to be free; that means in the
second place, that they should have the right to use their powers of mind
and body unhindered in any honest calling, in any useful art, in any branch
of science; so that they can be active and industrious, follow skilled
employments, or discharge the functions of office in order to maintain
themselves and their families and not be a burden upon others. This they
desire without having to fear that the Gentile competitor should be able to
say to them: only Gentile hands, only Gentile craftsmen may be employed
in skilled trades, only Gentile applicants are admitted to official positions,
only Gentile abilities can assert themselves. And as there are too many of
you, we must make laws to limit your activities—otherwise we shall
boycott you! They demand to be free; that means in the third place that they
must be free also as regards their conscience: if their sons possess sufficient
talent and knowledge to serve the country as scholars or as public officials,
they should be able to do so as honest Jews, and not be compelled to parade
as dishonest Christians, that is to profane the ceremony of baptism and to
use the certificate of baptism as a passport to office; they do not wish to act
as hypocrites, they do not wish to enter Christian communities by lying and
knavery, or to smuggle themselves in that way into civic life. They wish to
live as Jews, that means to maintain and to develop undisturbed in their true
spirit their customs, their traditions, their system of education, their
communities, etc. In short, they wish to be human beings, since he that may
not be a citizen with a citizen’s full rights in the place where he lives and
works and bears his share in all social burdens, has been denied the right to
be a human being; or if rights are granted to a man under the condition that
he should become assimilated and cease to be what he has been, thanks to
his race and the traditions sacred to him, against that man’s manhood the
crime of murder has been committed. They wish to be free human beings.
This question indeed concerns humanity. It was raised at the end of the
eighteenth century by the great French Revolution, and in some states with
small Jewish populations it has been solved in a spirit of liberty. France,
England, Italy were the pioneers of equal rights for all. The United States of
America were an example in establishing the freedom of citizenship.
Nevertheless the majority of the Jews presented during the course of the
nineteenth century a pitiful spectacle of unceasing martyrdom—with many
shades from semi-emancipation linked with anti-semitism, to boycott and
massacres.
The world is changing all its values, and should there be in any country
a continuation of tyranny, oppression, and barbarous persecution with
regard to the Jews, under any pretext—of which there has never and
nowhere seemed to be a lack—then the great ideal of this world-war will
remain an idle dream. For justice can never exist together with injustice.
This problem of humanity must now be and will be solved.
But the essential problem of modern political evolution lies deeper than
this: it is the problem of the peoples that have been robbed of their lands.
No matter how the position of the Jews may be ameliorated, and although
many Jews may find a home here and there, nevertheless the genius of the
Jewish people, the energy of its constructive power, its creative force will
have no adequate means of expression. To have a strong impulse to live
their own full life and not to be able to do so—that is the heart-breaking
tragedy of this people. This essential dilemma is left untouched by the
vague formula of Emancipation. Zionism is the only remedy for the deeper
Jewish problem, because Zionism alone goes to the real root of the trouble.
There can be no Emancipation worthy of the name without a homeland. The
greatest danger to Zionism as well as to anti-Zionism is that the ideal of
Zionism on the one hand and that of Emancipation on the other should be
separated, and that people should come to regard as antagonistic objects
which are essentially related and complementary to one another. Not all
Jews will return to Palestine, but large numbers will. Zionism represents
one of the highest manifestations of that aspiration to free national existence
which is the basis of the reconstruction of the world. When a people,
uprooted for centuries from its soil, scattered like dust over the whole
world, wants to restore its homeland to-day, to have a land where it can be
reunited, then we have before us a proof of the new power that lies in the
national idea. Millions of Jews are attached to Palestine with all their soul
and strength, just as on the first day of the forced expulsion of their
ancestors from their old home: their prayers, their lamentations, their
dreams have centred for generations upon this magnetic pole of their love
and reverence. Hundreds of times they made desperate efforts to return, but
were prevented by powerful circumstances from doing so, and as soon as
they had the opportunity of beginning again the re-settlement of Palestine,
notwithstanding unspeakable sufferings and the greatest sacrifices, they
instantly and energetically availed themselves of it. If the millions of Jewish
emigrants who formed the new ghettoes of Europe and America from about
1880 to now had had the possibility of going to Palestine, they would have
gladly seized it, because they wished to live as a nation, but that was not
possible at that time. Israel must have its own home. Palestine must become
the spiritual and cultural centre of the Jews. Properly developed, it can hold
millions of homeless Jews who will at last have their own homeland and
their own full nationality. If it is a misfortune for a people to be robbed of
its country, where it could live in peace and prosperity as a nation and enjoy
in common with the rest of the family of nations the fruits of its labour, then
this misfortune is not smaller but rather has become greater for having
existed two thousand years. If it is an injustice to withhold from a people a
land to which they have a right, then this injustice is not the smaller, but
rather the greater, when a people has suffered it for two thousand years.
Never has a nation governed its own home for a longer period; no nation’s
history, religion, literature, and traditions are more closely bound up with its
land; and no nation has ever suffered a more terrible martyrdom after
having been disinherited. Can anyone doubt the right of the Jewish people
to the land of Israel? The validity of the Jewish title to Palestine rests on the
same basis as the title of any nation to any particular area of the world
where it has ruled and existed for centuries. The Jews’ historical right on
the Land of Israel, with due consideration for the rights and interests of the
non-Jewish population which will be safe-guarded and respected, must
become the decisive factor in the question of Palestine.
At last the time has come. The spirit of freedom is on the wing, the
Great Creative Spirit is once more moving among the nations. The new
territorial settlement is going to lay the foundations of the world’s peace on
a basis of justice and national union. The liberation of oppressed
nationalities, the restoration of territories violently annexed in the past, the
recognition of the desire of racial units and groups for autonomy are the
great objects in view. The wrongs of the centuries are going to be righted,
and the Jewish race to be placed on an equal footing with other races. The
Jewish people is standing at a momentous turning point in its history of four
thousand years, to which the determined labour of Zionism has paved the
way. The very roots of Jewish nationality are set in that soil which after
being for ages in shadow is again turning to light. With the victory of the
national idea Zionism also has won a victory. Now that Palestine is freed,
much is possible which formerly was only an aspiration. The field is
immense and ready. The evil demon of the Pharaohs and of Antiochus
Epiphanes has been cast out; the glorious genius of Cyrus the Great hovers
with wings of love over the wonderful destiny of the Jewish people.
Powerful nations and governments—the guardians of freedom and the
champions of justice—have solemnly pledged themselves to further with all
the forces at their disposal the revival of the Jewish nation in the land of
Israel. Under this guiding symbol the problem of Palestine will be
discussed and settled by the Peace Conference among all the important
questions before it. The work is stupendous in its implications and its
responsibilities. No one imagines that this result can be speedily attained.
Its accomplishment will take time, and quite possibly a long time. To
restore a scattered people to a land long neglected is not an easy task. The
Jewish colonization of Palestine must be carefully built, stone upon stone,
by the steady hands of Zionists with that spirit of self-sacrificing endurance
which saved our nationality, with wisdom and self-restraint. Zionists are
aware of what the Holy Places of Palestine, places of traditional
associations and religious faith, consecrated by a thousand cherished
memories, are to the great religions. These places will receive equal respect;
they will be, not less, but more than hitherto reverently exalted as places of
the rarest and sweetest memories in the world. Zionists have the most
scrupulous regard for all spiritual things and needs of all religions, and are
confident that all Holy Places will be safeguarded by arrangements to be
introduced. Zionists are also alive to the legitimate interests and needs of
the non-Jewish population, whose liberty and welfare, in peace and
harmony and mutual respect, are most essential for the success of the
Jewish national rebirth. The new Jewish centre must be made worthy of its
glorious past. The noblest ambitions of Jews all over the world are
concentrated on this point.
I.
T P I N
R
T first prophet who has left any definite revelation concerning the
Dispersion of the Jews and their ultimate restoration in Palestine was
Moses, our Law-giver.
“And I will bring the land into desolation; and your enemies that dwell therein shall be
astonished at it.” (Leviticus xxvi. 32.)
“And you will I scatter among the nations, and I will draw out the sword after you;
and your land shall be a desolation, and your cities shall be a waste.” (Ibid. 33.)
“And yet for all that, when they are in the land of their enemies, I will not reject them,
neither will I abhor them, to destroy them utterly, and to break My covenant with them; for
I am the Lord their God.” (Ibid. 44.)
“But I will for their sakes remember the covenant of their ancestors, whom I brought
forth out of the land of Egypt in the sight of the nations, that I might be their God: I am the
Lord.” (Ibid. 45.)
“for all the land which thou seest, to thee will I give it, and to thy seed for ever:” (Ibid. 15.)
Again we read:—
“And the Lord shall scatter you among the peoples,...” (Deuteronomy iv. 27.)
“But from thence ye will seek the Lord thy God; and thou shalt find Him, if thou
search after Him with all thy heart and with all thy soul.” (Ibid. 29.)
“In thy distress, when all these things are come upon thee, in the end of days, thou wilt
return to the Lord thy God, and hearken unto His voice;” (Ibid. 30.)
“for the Lord thy God is a merciful God; He will not fail thee, neither destroy thee, nor
forget the covenant of thy fathers which He swore unto them.” (Ibid. 31.)
“that then the Lord thy God will turn thy captivity, and have compassion upon thee, and
will return and gather thee from all the peoples, whither the Lord thy God hath scattered
thee.” (Ibid. 3.)
“If any of thine that are dispersed be in the uttermost parts of heaven, from thence will
the Lord thy God gather thee, and from thence will He fetch thee.” (Ibid. 4.)
“And the Lord thy God will bring thee into the land which thy fathers possessed, and
thou shalt possess it; and He will do thee good, and multiply thee above thy fathers.”
(Ibid. 5.)
Amongst the “things which should come upon them,” which are
described at large in the twenty-eighth and twenty-ninth chapters of
Deuteronomy, it is particularly said:—
“And the Lord shall scatter thee among all peoples, from the one end of the earth even
unto the other end of the earth;...” (Ibid. xxviii. 64.)
which promises do not appear to have been fulfilled during the time of the
Babylonian captivity, or after the return from Babylon.
Here we have in plain words, simple and clear, the fundamental idea of
Moses: the Jewish national future and the possession of the land for ever.
This cannot be explained away by sophistry. In vain some Jews declare: We
are not nationalist Jews, we are religious Jews! What is the Jewish religion
if the Bible is not accepted as an Inspired Revelation? It is strange and sadly
amusing that some Jews, adherents of the monotheistic principle, describe
themselves as Germans, Magyars, and so on, “of the persuasion of Moses.”
If this is not blasphemy, it is irony. The real Moses, the Moses of the
Pentateuch, brands Dispersion as a curse, and his whole religious
conception, with all the laws, ceremonies, feasts, etc., is built up on the
basis of the covenant with the ancestors, a covenant immovable and
unalterable. No matter whether Jews call themselves religious or
nationalist: the Jewish religion cannot be separated from nationalism, unless
another Bible is invented.
And I will no more make you a reproach among the nations;” (Ibid. 19.)
When I shall bring back the captivity of Judah and Jerusalem,” (Ibid. iv. 1.)
Amos, who was among the herdmen of Tekoa, lived in the days of
Jeroboam, the son of Joash, King of Israel, and prophesied to the Kingdom
of Israel from eight hundred and eight, to seven hundred and eighty-three
years before the civil era:—