Source code online books for professionals by professionals



Download 4,67 Mb.
Pdf ko'rish
bet243/266
Sana31.12.2021
Hajmi4,67 Mb.
#213682
1   ...   239   240   241   242   243   244   245   246   ...   266
Bog'liq
2 5296731884800181221

Kosaraju’s algorithm. Finds strongly connected components, using DFS. First, nodes are ordered by their finish 
times. Then the edges are reversed, and another DFS is run, selecting start nodes using the first ordering. Running 
time Q(n+m). (See Listing 5-11.)
Kruskal’s algorithm. Finds a minimum spanning tree by repeatedly adding the smallest remaining edge that doesn’t 
create a cycle. This cycle checking can (with some cleverness) be performed very efficiently, so the running time is 
dominated by sorting the edges. All in all, the running time is Q(m lg n). (See Listing 7-4.)
Linked lists. An alternative to arrays for representing sequences. Although linked lists are cheap (constant time) to 
modify once you’ve found the right entries, finding those normally takes linear time. Linked lists are implemented 
sort of like a path, with each node pointing to the next. Note that Python’s list type is implemented as an array, not a 
linked list. (See Chapter 2.)


Appendix B 

 List of proBLems And ALgorithms
265
Merge sort. The archetypal divide-and-conquer algorithm. It divides the sequence to be sorted in the middle, sorts 
the two halves recursively, and then merges the two sorted halves in linear time. The total running time is Q(n lg n). 
(See Listing 6-5.)

Download 4,67 Mb.

Do'stlaringiz bilan baham:
1   ...   239   240   241   242   243   244   245   246   ...   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