Dab tsi yog asymptotic notation piav qhia qhov loj 0 cim?
Dab tsi yog asymptotic notation piav qhia qhov loj 0 cim?

Video: Dab tsi yog asymptotic notation piav qhia qhov loj 0 cim?

Video: Dab tsi yog asymptotic notation piav qhia qhov loj 0 cim?
Video: О невесте Димаша (SUB) 2024, Kaum ib hlis
Anonim

Loj-O . Loj-O , feem ntau sau li O , yog ib Asymptotic Lus Cim rau qhov phem tshaj plaws, los yog qab nthab ntawm kev loj hlob rau ib tug muab functionality. Nws muab rau peb nrog ib tug asymptotic Upper khi rau txoj kev loj hlob tus nqi ntawm lub runtime ntawm ib tug algorithm.

Ib yam li ntawd, tib neeg nug, koj txhais li cas los ntawm Big O notation?

Big O notation yog siv hauv Computer Science los piav txog qhov kev ua tau zoo lossis qhov nyuaj ntawm cov algorithm. Loj O tshwj xeeb piav txog qhov xwm txheej phem tshaj plaws, thiab ua tau siv los piav txog lub sijhawm ua tiav uas yuav tsum tau ua lossis qhov chaw siv (piv txwv li hauv nco lossis hauv disk) los ntawm algorithm.

Vim li cas Big O notation tseem ceeb? Big O notation tso cai rau koj los soj ntsuam algorithms ntawm tag nrho cov efficiency thiab scaleability. Nws abstracts deb qhov kev txiav txim tsis tu ncua nyob rau hauv kev ua tau zoo uas tuaj yeem sib txawv ntawm lub platform, lus, OS kom tsom mus rau qhov ua tau zoo ntawm cov algorithm thiab nws txawv li cas raws li qhov loj ntawm cov tswv yim.

Yog li ntawd, yog Big O notation yog qhov phem tshaj?

Txawm tias loj o notation tsis muaj dab tsi ua nrog lub qhov phem tshaj plaws tsom xam, peb feem ntau sawv cev rau qhov phem tshaj plaws los ntawm loj o notation . Yog li, Hauv kev tshawb nrhiav binary, qhov zoo tshaj plaws cas yog O (1), nruab nrab thiab qhov phem tshaj plaws yog O (logn). Hauv luv luv, tsis muaj kev sib raug zoo ntawm hom loj O yog siv rau qhov phem tshaj plaws , Theta rau nruab nrab cas ”.

Qhov loj O thiab me me O cim yog dab tsi?

Loj - O yog ib tug inclusive Upper bound, thaum me ntsis - o yog ib tug nruj kev cia siab. Piv txwv li, txoj haujlwm f(n) = 3n yog: hauv O (n²), o (n²), thiab O (n)

Pom zoo: