Eng yahshi, o’rtacha va eng yomon algoritmlar.
Yuqoridagi misollarga asoslanib shuni aytish mumkinki, algoritmlar samaradorligi bo’yicha 3 hil bolishi mumrin: 1) Eng yomon holat bunda algoritm masalani echish uchun maksimal sondagi amallarni bajarishni talab qiladi; 2) Eng yaxshi holat bunda algoritm masalani echish uchun minimal sondagi amallarni bajarishni talab qiladi; 3) Ortacha holat bunda algoritm masalani echish uchun maksimal va minimal sonlar orasidagi sondagi amallarni bajarishni talab qiladi.
Sodda hollarda ortacha samaradorlikni aniqlash algoritmga mumkin bolgan kirishlar, har bir kirish uchun algoritm asosida bajarilayotgan etaplar sonini aniqlash, barcha kirishlar uchun qadamlar sonini aniqlash va ularning hammasini qoshib hisoblangandan song kirishlar soniga bolish yordamida amalda oshiriladi.
Отменить изменения
Помогите нам повысить качество перевода
Спасибо!
Предложенный вами текст будет использоваться для улучшения качества машинного перевода. Кроме того, он может быть анонимно показан другим пользователям.
Предложить перевод
Закрыть
Ō i & thetas Notatsii
Big-O oboznacheniye otnositsya k verkhney grani funktsiy. Sushchestvuyet simmetrichnoye opredeleniye dlya otsenki snizu v opredelenii big-P:
Opredeleniye 2: Funktsiya R (p) Ō (g (p)), yesli sushchestvuyut polozhitel'nyye chisla N i C
takaya, chto R (p) ≥ G (p) dlya vsekh p ^ N.
Eto opredeleniye glasit: F yavlyayetsya Ō (big-omega) iz g, yesli sushchestvuyet takoye polozhitel'noye chislo s, chto
F sostavlyayet po men'shey mere ravna Cg dlya pochti vsekh ns. Drugimi slovami, CG (p) yavlyayetsya nizhnyaya granitsa
razmer F (N), ili, v konechnom schete, F vozrastayet po krayney mere, so skorost'yu g.
Yedinstvennoye razlichiye mezhdu etim opredeleniyem i opredeleniyem bol'shogo O notatsii yavlyayetsya napravleniye neravenstva; odno opredeleniye mozhet byt' prevrashchen v drugoy
putem zameny "≥" s "≤". Sushchestvuyet vzaimosvyaz' mezhdu etimi dvumya notatsiyami
vyrazhayetsya ekvivalentnosti
ye (p) Ō (g (p)) togda i tol'ko togda g (p) O (F (p))
Ō oboznacheniya stradayet ot toy zhe problemy izobilii, kak eto delayet bol'shoy-O oboznacheniya:
Sushchestvuyet neogranichennoye kolichestvo variantov dlya konstant s i N. Dlya uravneniya 2.2,
my ishchem takoy s, dlya kotorykh 2n2 + 3n + 1 ≥ CN2, chto spravedlivo dlya lyubogo p ≥ 0, yesli
C ≤ 2, gde 2 yavlyayetsya predelom dlya s na risunke 2.2. Krome togo, yesli F yavlyayetsya Ō d i ch ≤ G, to R
Ō N; to yest', yesli dlya ye my mozhem nayti odin g takoy, chto F yavlyayetsya Ō d, to my mozhem nayti
beskonechno mnogo. Naprimer, funktsiya 2.2 yavlyayetsya Ō p2, no i ot p, p1 / 2, n1 / 3,
n1 / 4,. , , , A takzhe Lg p, p dlya LG,. , , , I mnogikh drugikh funktsiy. Dlya prakticheskogo
tseli, tol'ko samyye blizkiye Ōs samyye interesnyye (t.ye. samyye bol'shiye nizhniye granitsy).
Eto ogranicheniye sdelano neyavno kazhdyy raz, kogda my vybirayem Q, takoy funktsii f.
Yest' beskonechnoye chislo vozmozhnykh nizhnikh otsenok dlya funktsii F; to yest',
sushchestvuyet beskonechnoye mnozhestvo gs, chto R (p) Ō (g (p)), a takzhe neogranichennoye chislo vozmozhnykh verkhnikh graney f. Eto mozhet byt' neskol'ko nastorazhivayet, poetomu my ogranichimsya
nashe vnimaniye k mel'chayshim verkhnikh graney i krupneyshikh nizhnikh granits. Obratite vnimaniye, chto
yest' obshchaya osnova dlya bol'shogo-O i notatsiy Om, oboznachennom ravenstv
Opredeleniya etikh oboznacheniy: Big-O opredelena v terminakh "≤" i Q, s tochki zreniya
"≥"; "=" Vklyuchen v oboikh neravenstv. Eto navodit na mysl' sposob ogranicheniya mnozhestva
vozmozhnyye verkhnyaya i nizhnyaya granitsy. Eto ogranicheniye mozhet byt' dostignuto s pomoshch'yu sleduyushchego opredeleniya Q (teta) oboznacheniya:
Opredeleniye 3: ye (p) TH (g (p)), yesli sushchestvuyut polozhitel'nyye chisla c1, c2, i N takiye, chto
s
1 g (p) ≤ F (N) ≤ c2g (p) dlya vsekh p ^ N.
C8160_ch02_ptg01.indd 56 20/04/12 12:12 vechera
S ye s t o n ya 2. 6 E kh a m r l Ye N I YA
Присоединяйтесь к сообществу Google Переводчика
Конец формы
Do'stlaringiz bilan baham: |