Source code online books for professionals by professionals



Download 4,67 Mb.
Pdf ko'rish
bet240/266
Sana31.12.2021
Hajmi4,67 Mb.
#213682
1   ...   236   237   238   239   240   241   242   243   ...   266
Bog'liq
2 5296731884800181221

Huffman’s algorithm. Builds Huffman trees, which can be used for building optimal prefix codes, for example. 
Initially, each element (for example, character in an alphabet) is made into a single-node tree, with a weight equal to 
its frequency. In each iteration, the two lightest trees are picked, combining them with a new root and giving the new 
tree a weight equal to the sum of the original two tree weights. This can be done in loglinear time (or, in fact, in linear 
time if the frequencies are presorted). (See Listing 7-1.)
Insertion sort. A simple sorting algorithm with quadratic running time. It works by repeatedly inserting the next 
unsorted element in an initial sorted segment of the array. For small data sets, it can actually be preferable to more 
advanced (and optimal) algorithms such as merge sort or quicksort. (In Python, though, you should use list.sort or 
sorted if at all possible.) (See Listing 4-3.)

Download 4,67 Mb.

Do'stlaringiz bilan baham:
1   ...   236   237   238   239   240   241   242   243   ...   266




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