Cov txheej txheem:

Dab tsi yog cov txheej txheem hauv programming?
Dab tsi yog cov txheej txheem hauv programming?

Video: Dab tsi yog cov txheej txheem hauv programming?

Video: Dab tsi yog cov txheej txheem hauv programming?
Video: Yog Vim Dab Tsi - Maiv Choj (cover) 2024, Kaum ib hlis
Anonim

Hauv computer science, a teeb yog cov ntaub ntawv paub daws teeb uas tuaj yeem khaws cov txiaj ntsig tshwj xeeb, yam tsis muaj kev txiav txim tshwj xeeb. Nws yog ib lub computer siv lub tswv yim lej ntawm afinite teeb . Lwm yam variants, hu ua dynamic lossis mutable teeb , tso cai rau kev ntxig thiab tshem tawm cov ntsiab lus los ntawm cov teeb.

Yog li ntawd, cov txheej txheem thiab cov piv txwv yog dab tsi?

A teeb yog ib pab pawg los yog sau cov khoom ornumbers, suav tias yog ib qho chaw rau nws tus kheej. Txhua yam khoom lossis tus lej hauv a teeb yog hu ua ib tug tswv cuab los yog lub hauv paus ntawm lub teeb . Piv txwv suav nrog teeb ntawm tag nrho cov computers nyob rau hauv lub ntiaj teb no, lub teeb ntawm tag nrho cov txiv apples ntawm tsob ntoo, thiab teeb ntawm tag nrho cov irrational tooj ntawm 0 thiab 1.

Qhov thib ob, dab tsi yog qhov teeb tsa hauv Python? Teeb tsa hauv Python . A Teeb yog ib hom ntaub ntawv unorderedcollection uas yog iterable, mutable, thiab muaj noduplicate ntsiab. Python's set chav kawm sawv cev rau lawv txoj kev xav ntawm a teeb . Qhov no yog ua raws li cov qauv ntaub ntawv hu ua lub rooj hash.

Ib yam li ntawd, nws yog nug, dab tsi yog qhov teeb meem hauv cov ntaub ntawv qauv?

A Teeb yog abstract cov ntaub ntawv hom uas tuaj yeem khaws qee qhov txiaj ntsig, yam tsis muaj kev txiav txim tshwj xeeb, thiab tsis muaj nqi rov qab. Nws yog lub computer siv lub tswv yim lej ntawm tus finite Teeb . Los ntawm Wikipedia. Cov Teem datastructure feem ntau yog siv los kuaj seb cov khoom puas yog teeb ntawm qhov muaj nqis.

Dab tsi yog 3 txoj hauv kev los piav txog ib txheej?

Kev txhais thiab Kev Sawv Cev ntawm Teeb

  • Definition of ib Set:
  • Lus Cim: Ib txheej feem ntau yog sau los ntawm cov tsiaj ntawv loj, i.e.
  • Kev Sawv Cev Ntawm Cov Teeb: Muaj peb txoj hauv kev los sawv cev rau cov khoom vaj khoom tsev.
  • I. Tabular Form: Sau tag nrho cov ntsiab lus ntawm ib lub teeb, sib cais los ntawm commas thiab kaw nyob rau hauv curly brackets {}.
  • Piv txwv li: A={1, 2, 3, 4, 5}, B{2, 4, 6, ⋯, 50}, C{1, 3, 5, 7, 9, ⋯}

Pom zoo: