Source code online books for professionals by professionals



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

Hashing, hash tables. Look up a key to get the corresponding value, just like in a search tree. Entries are stored in  
an array, and their positions are found by computing a (pseudorandom, sort of) hash value of the key. Given a good 
hash function and enough room in the array, the expected running time of insertion, deletion and lookup is Q(1).  
(See Chapter 2.)
Heaps, heapsort. Heaps are efficient priority queues. With linear-time preprocessing, a min- (max-) heap will let you 
find the smallest (largest) element in constant time and extract or replace it in logarithmic time. Adding an element 
can also be done in logarithmic time. Conceptually, a heap is a full binary tree where each node is smaller (larger) 
than its children. When modifications are made, this property can be repaired with Q(lg n) operations. In practice, 
heaps are usually implemented using arrays (with nodes encoded as array entries). A very efficient implementation 
can be found in the heapq module. Heapsort is like selection sort, except that the unsorted region is a heap, so finding 
the largest element n times gives a total running time of Q(n lg n). (See the “Black Box” sidebar on heaps, heapq, and 
heapsort in Chapter 6.)

Download 4,67 Mb.

Do'stlaringiz bilan baham:
1   ...   235   236   237   238   239   240   241   242   ...   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