Introduction to Algorithms, Third Edition


Part I. All the chapters in Part I and the Appendices are written with a tutorial



Download 4,84 Mb.
Pdf ko'rish
bet11/618
Sana07.04.2022
Hajmi4,84 Mb.
#534272
1   ...   7   8   9   10   11   12   13   14   ...   618
Bog'liq
Introduction-to-algorithms-3rd-edition


Part I. All the chapters in Part I and the Appendices are written with a tutorial
flavor.


1
The Role of Algorithms in Computing
What are algorithms? Why is the study of algorithms worthwhile? What is the role
of algorithms relative to other technologies used in computers? In this chapter, we
will answer these questions.
1.1
Algorithms
Informally, an
algorithm
is any well-defined computational procedure that takes
some value, or set of values, as
input
and produces some value, or set of values, as
output
. An algorithm is thus a sequence of computational steps that transform the
input into the output.
We can also view an algorithm as a tool for solving a well-specified
computa-
tional problem
. The statement of the problem specifies in general terms the desired
input/output relationship. The algorithm describes a specific computational proce-
dure for achieving that input/output relationship.
For example, we might need to sort a sequence of numbers into nondecreasing
order. This problem arises frequently in practice and provides fertile ground for
introducing many standard design techniques and analysis tools. Here is how we
formally define the
sorting problem
:
Input:
A sequence of
n
numbers
h
a
1
; a
2
; : : : ; a
n
i
.
Output:
A permutation (reordering)
h
a
0
1
; a
0
2
; : : : ; a
0
n
i
of the input sequence such
that
a
0
1
a
0
2
a
0
n
.
For example, given the input sequence
h
31; 41; 59; 26; 41; 58
i
, a sorting algorithm
returns as output the sequence
h
26; 31; 41; 41; 58; 59
i
. Such an input sequence is
called an

Download 4,84 Mb.

Do'stlaringiz bilan baham:
1   ...   7   8   9   10   11   12   13   14   ...   618




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©hozir.org 2024
ma'muriyatiga murojaat qiling

kiriting | ro'yxatdan o'tish
    Bosh sahifa
юртда тантана
Боғда битган
Бугун юртда
Эшитганлар жилманглар
Эшитмадим деманглар
битган бодомлар
Yangiariq tumani
qitish marakazi
Raqamli texnologiyalar
ilishida muhokamadan
tasdiqqa tavsiya
tavsiya etilgan
iqtisodiyot kafedrasi
steiermarkischen landesregierung
asarlaringizni yuboring
o'zingizning asarlaringizni
Iltimos faqat
faqat o'zingizning
steierm rkischen
landesregierung fachabteilung
rkischen landesregierung
hamshira loyihasi
loyihasi mavsum
faolyatining oqibatlari
asosiy adabiyotlar
fakulteti ahborot
ahborot havfsizligi
havfsizligi kafedrasi
fanidan bo’yicha
fakulteti iqtisodiyot
boshqaruv fakulteti
chiqarishda boshqaruv
ishlab chiqarishda
iqtisodiyot fakultet
multiservis tarmoqlari
fanidan asosiy
Uzbek fanidan
mavzulari potok
asosidagi multiservis
'aliyyil a'ziym
billahil 'aliyyil
illaa billahil
quvvata illaa
falah' deganida
Kompyuter savodxonligi
bo’yicha mustaqil
'alal falah'
Hayya 'alal
'alas soloh
Hayya 'alas
mavsum boyicha


yuklab olish