Puas yog array yog cov qauv ntaub ntawv lossis hom ntaub ntawv?
Puas yog array yog cov qauv ntaub ntawv lossis hom ntaub ntawv?

Video: Puas yog array yog cov qauv ntaub ntawv lossis hom ntaub ntawv?

Video: Puas yog array yog cov qauv ntaub ntawv lossis hom ntaub ntawv?
Video: Mathematics with Python! Sequences 2024, Hlis ntuj nqeg
Anonim

Ib array yog homogeneous cov ntaub ntawv qauv (cov ntsiab lus muaj tib yam hom ntaub ntawv ) uas khaws cov khoom sib txuas ntawm cov khoom sib txuas ua ke - faib rau hauv kev nco sib txuas. Txhua yam khoom ntawm array tuaj yeem nkag tau los ntawm kev siv nws tus lej (piv txwv li, index). Thaum koj tshaj tawm ib array , koj teev nws loj.

Kuj paub, hom ntaub ntawv twg yog ib qho array?

Hauv computer science, ib array cov ntaub ntawv qauv , orsimly ib array , yog a cov ntaub ntawv qauv suav nrog kev sau cov ntsiab lus (tus nqi lossis qhov sib txawv), txhua tus txheeb xyuas yam tsawg kawg ib qho array index los yog key.

Ib sab saum toj no, dab tsi yog qhov qauv ntaub ntawv hom? Qauv Txhais A cov ntaub ntawv hom yog ib qho compound hom ntaub ntawv uas ntog nyob rau hauv cov neeg siv-txhais qeb thiab siv forgrouping yooj yim hom ntaub ntawv los yog lwm yam compound hom ntaub ntawv . Qhov no muaj ib ntu ntawm cov tswv cuab sib txawv npe nrog lawv hom / cwj pwm thiab lawv tau muab kaw rau hauv curl brackets.

Tsis tas li ntawd, yog sau ib hom ntaub ntawv lossis cov qauv ntaub ntawv?

Cov qauv ntaub ntawv yog kev sau ntawm ntau yam ntawm cov ntaub ntawv . Tag nrho ntawd cov ntaub ntawv tuaj yeem sawv cev siv ib yam khoom thiab tuaj yeem siv thoob plaws txhua qhov haujlwm. Cov cov ntaub ntawv yog muab rau lub cov ntaub ntawv qauv cov khoom siv qee cov txheej txheem algorithms thiab cov haujlwm xws li thawb, pop thiab sai sai.

Vim li cas peb siv array?

Computer Programming - Arrays . Nws yog qhov yooj yim, vim peb yuav tsum khaws tsib tus lej xwb. Ib array yog siv khaws cov ntaub ntawv khaws tseg, tab sis itis feem ntau pab tau ntau dua los xav txog ib qho array raws li ib tug sau ntawm variables ntawm tib hom.

Pom zoo: