Introduction to Algorithms, Third Edition



Download 4,84 Mb.
Pdf ko'rish
bet24/618
Sana07.04.2022
Hajmi4,84 Mb.
#534272
1   ...   20   21   22   23   24   25   26   27   ...   618
Bog'liq
Introduction-to-algorithms-3rd-edition

Pseudocode conventions
We use the following conventions in our pseudocode.
Indentation indicates block structure. For example, the body of the
for
loop that
begins on line 1 consists of lines 2–8, and the body of the
while
loop that begins
on line 5 contains lines 6–7 but not line 8. Our indentation style applies to
if
-
else
statements
2
as well. Using indentation instead of conventional indicators
of block structure, such as
begin
and
end
statements, greatly reduces clutter
while preserving, or even enhancing, clarity.
3
The looping constructs
while
,
for
, and
repeat
-
until
and the
if
-
else
conditional
construct have interpretations similar to those in C, C++, Java, Python, and
Pascal.
4
In this book, the loop counter retains its value after exiting the loop,
unlike some situations that arise in C++, Java, and Pascal. Thus, immediately
after a
for
loop, the loop counter’s value is the value that first exceeded the
for
loop bound. We used this property in our correctness argument for insertion
sort. The
for
loop header in line 1 is
for
j
D
2
to
A:
length
, and so when
this loop terminates,
j
D
A:
length
C
1
(or, equivalently,
j
D
n
C
1
, since
n
D
A:
length
). We use the keyword
to
when a
for
loop increments its loop
2
In an
if
-
else
statement, we indent
else
at the same level as its matching

Download 4,84 Mb.

Do'stlaringiz bilan baham:
1   ...   20   21   22   23   24   25   26   27   ...   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