Source code online books for professionals by professionals


Finding the minimum/maximum/median



Download 4,67 Mb.
Pdf ko'rish
bet224/266
Sana31.12.2021
Hajmi4,67 Mb.
#213682
1   ...   220   221   222   223   224   225   226   227   ...   266
Bog'liq
2 5296731884800181221

Finding the minimum/maximum/median. Finding the minimum and maximum of a sequence can be found in 
linear time by a simple scan. Repeatedly finding and extracting the maximum or minimum in constant time, given 
linear-time preparation, can be done using a binary heap. It is also possible to find the kth smallest element of a 
sequence (the median for k = n/2) in linear (or expected linear) time, using the select or randomized select.  
(For more information, see Chapter 6.)
Flow and cut problems. How many units of flow can be pushed through a network with flow capacities on the edges? 
That is the max-flow problem. An equivalent problem is finding the set of edge capacities that most constrain the flow; 
this is the min-cut problem. There are several versions of these problems. For example, you could add costs to the edges 
and find the cheapest of the maximum flows. You could add a lower bound on each edge and look for a feasible flow. You 
could even add separate supplies and demands in each node. These problems are dealt with in detail in Chapter 10.
Graph coloring. Try to color the nodes of a graph so that no neighbors share a color. Now try to do this with a given 
number of colors, or even to find the lowest such number (the chromatic number of the graph). This is an NP-hard 
problem in general. If, however, you’re asked to see whether a graph is two-colorable (or bipartite), the problem 
can be solved in linear time using simple traversal. The problem of finding a clique cover is equivalent to finding an 
independent set cover, which is an identical problem to graph coloring. (See Chapter 11 for more on graph coloring.)

Download 4,67 Mb.

Do'stlaringiz bilan baham:
1   ...   220   221   222   223   224   225   226   227   ...   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