B ntoo cov ntaub ntawv qauv yog dab tsi?
B ntoo cov ntaub ntawv qauv yog dab tsi?

Video: B ntoo cov ntaub ntawv qauv yog dab tsi?

Video: B ntoo cov ntaub ntawv qauv yog dab tsi?
Video: Ke hlub yog dab tsi? 2024, Kaum ib hlis
Anonim

A B - tsob ntoo yog a ntoo cov ntaub ntawv qauv uas khaws cia cov ntaub ntawv txheeb thiab tso cai rau kev tshawb nrhiav, ntxig, thiab tshem tawm hauv logarithmic amortized lub sijhawm. Tsis zoo li tus kheej ntsuas binary nrhiav ntoo , nws yog optimized rau systems uas nyeem thiab sau loj blocks ntawm cov ntaub ntawv . Nws yog feem ntau siv nyob rau hauv database thiab cov ntaub ntawv systems. Cov B - Tsob ntoo Cov cai.

Tom qab ntawd, ib tug kuj yuav nug, dab tsi yog tsob ntoo B nyob rau hauv cov ntaub ntawv qauv nrog piv txwv?

B - Tsob ntoo yog kev nrhiav tus kheej sib npaug tsob ntoo nyob rau hauv uas txhua node muaj ntau tus yuam sij thiab muaj ntau tshaj ob tug me nyuam. Ntawm no, tus naj npawb ntawm cov yuam sij nyob rau hauv ib lub node thiab tus naj npawb ntawm cov me nyuam rau ib lub node nyob ntawm qhov kev txiav txim ntawm B - Tsob ntoo . Txhua B - Tsob ntoo muaj kev txiav txim.

Tsis tas li ntawd, tsob ntoo B thiab B + tsob ntoo yog dab tsi hauv cov ntaub ntawv qauv? B+ tsob ntoo . B+ tsob ntoo yog ib tug extension ntawm B tsob ntoo uas tso cai rau kev nkag tau zoo, tshem tawm thiab tshawb nrhiav haujlwm. Hauv B tsob ntoo , Cov yuam sij thiab cov ntaub ntawv ob leeg tuaj yeem khaws cia rau hauv sab hauv nrog rau cov nplooj ntoo. Piv txwv li, hauv B+ tsob ntoo , cov ntaub ntawv ( cov ntaub ntawv ) tsuas tuaj yeem khaws cia rau ntawm nplooj nplooj thaum cov nodes sab hauv tuaj yeem khaws cov txiaj ntsig tseem ceeb.

Hauv qhov no, tsob ntoo B yog dab tsi hauv database?

O(log n) O(log n) Hauv computer science, a B - tsob ntoo yog kev ntsuas tus kheej tsob ntoo cov ntaub ntawv qauv uas tswj xyuas cov ntaub ntawv txheeb xyuas thiab tso cai rau kev tshawb nrhiav, kev nkag mus ua ntu zus, ntxig, thiab tshem tawm hauv lub sijhawm logarithmic. Cov B - tsob ntoo generalizes binary nrhiav tsob ntoo , tso cai rau cov nodes nrog ntau tshaj ob tug me nyuam.

Dab tsi yog qhov txawv ntawm B Ntoo thiab B + tsob ntoo hauv cov ntaub ntawv qauv?

Cov txawv hauv B+ tsob ntoo thiab B tsob ntoo yog in B tsob ntoo cov yawm sij thiab cov ntaub ntawv tuaj yeem khaws cia li sab hauv thiab cov nplooj ntawm qhov chaw nyob hauv B+ ntoo , cov ntaub ntawv khaws cia raws li nplooj nplooj thiab cov yuam sij tsuas yog khaws cia hauv cov nodes sab hauv. Cov ntaub ntawv raug txuas rau ib leeg hauv a linked lis fashion.

Pom zoo: