Introduction to Algorithms, Third Edition


Technicalities in recurrences



Download 4,84 Mb.
Pdf ko'rish
bet54/618
Sana07.04.2022
Hajmi4,84 Mb.
#534272
1   ...   50   51   52   53   54   55   56   57   ...   618
Bog'liq
Introduction-to-algorithms-3rd-edition

Technicalities in recurrences
In practice, we neglect certain technical details when we state and solve recur-
rences. For example, if we call M
ERGE
-S
ORT
on
n
elements when
n
is odd, we
end up with subproblems of size
b
n=2
c
and
d
n=2
e
. Neither size is actually
n=2
,
because
n=2
is not an integer when
n
is odd. Technically, the recurrence describing
the worst-case running time of M
ERGE
-S
ORT
is really
T .n/
D
(
‚.1/
if
n
D
1 ;
T .
d
n=2
e
/
C
T .
b
n=2
c
/
C
‚.n/
if
n > 1 :
(4.3)
Boundary conditions represent another class of details that we typically ignore.
Since the running time of an algorithm on a constant-sized input is a constant,
the recurrences that arise from the running times of algorithms generally have
T .n/
D
‚.1/
for sufficiently small
n
. Consequently, for convenience, we shall
generally omit statements of the boundary conditions of recurrences and assume
that
T .n/
is constant for small
n
. For example, we normally state recurrence (4.1)
as
T .n/
D
2T .n=2/
C
‚.n/ ;
(4.4)
without explicitly giving values for small
n
. The reason is that although changing
the value of
T .1/
changes the exact solution to the recurrence, the solution typi-
cally doesn’t change by more than a constant factor, and so the order of growth is
unchanged.
When we state and solve recurrences, we often omit floors, ceilings, and bound-
ary conditions. We forge ahead without these details and later determine whether
or not they matter. They usually do not, but you should know when they do. Ex-
perience helps, and so do some theorems stating that these details do not affect the
asymptotic bounds of many recurrences characterizing divide-and-conquer algo-
rithms (see Theorem 4.1). In this chapter, however, we shall address some of these
details and illustrate the fine points of recurrence solution methods.


68
Chapter 4
Divide-and-Conquer

Download 4,84 Mb.

Do'stlaringiz bilan baham:
1   ...   50   51   52   53   54   55   56   57   ...   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