sequence container (sii + +)

computinglo, sequence containerlu dayta muulakaala nilvanu amalu chese sii + + prograaming longuage yokka praamaanika libraryloni container class templatela samuuhaanni suuchistaayi. templatelu kaavadamtho, vaatini puurnaamkaalu ledhaa anukuula taragatulu vanti ekapaksha muulakaalanu nilva cheyadaaniki upayoginchavacchu. anni varusa containerla yokka oka saadhaarana lakshanam emitante, muulakaalanu varusaga access cheyavachu. anni itara praamaanika library bhagala maadirigaane, avi namespace "estidi" loe untaayi.
sii + + pramaanam yokka prastuta savaranalo eee krindi containerlu nirvachinchabaddayih kokvij _ 1, kokvij _ 2, kokvij _ 3, kokvij _ 4, kokvij _ 5. eee containerlalo prati okkati dayta nilva kosam ververu algaarithamlanu amalu chestaayi, antey avi ververu kaaryakalaapaalaku ververu vaega haameelanu kaligi untayih
prati container sarigga panicheyadaaniki daani muulakaalanu coppy cheyagalagaali kabatti, muulakaala rakam tappanisarigaa coque 11 mariyu coque 12 avasaralanu teerchaali.<riff paeru = "c + + 03 23.1/4"> iso/iec (2003). "iso/iec 14882:2003 (ii): prograaming bhashalu-sii + + §23.1 container avasaralu [lib.container.avasaralu] "paeraa. 4 icchina container kosam, anni muulakaalu oke rakaniki chendinavi ayi undaali. udaaharanaku, oke container sandarbhamlo chaar mariyu intla roopamlo daetaanu nilva cheyaleru.
charitra.
modata, coque _ 2, coque _ 3 mariyu coque _ 5 matrame nirvachinchabaddaayi. nirvachinchabaddaayi sii + + bhasha praamaaneekarana varaku, avi sgi prachurinchina praamaanika template library (stl) loe bhaagamgaa undevi. STL yokka praadhamika roopakarta alegzander stepanov, "vector" anae paeru empika gurinchi vicharam vyaktam chestu, idhi paatha prograaming longuages skeem mariyu lisp nundi vachindani, conny padam yokka ganita ardhaaniki viruddhamgaa undani chepparu.
coque _ 1 container modata vividha paerlatoe aneka pustakaalalo kanipinchindi. taruvaata dheenini boost librarylo chaerchaaru, mariyu praamaanika sii + + librarylo chaerchadaaniki pratipaadinchabadindi. kokvij _ _ chaerchadaaniki prerana emitante, idhi sii-style shreni yokka rendu samasyalanu parishkaristundih stl-lanty interfaces lekapovadam mariyu itara vastuvula maadirigaa coppy cheyalekapovadam. idhi modata sii + + + kanipinchindi, taruvaata sii + + + cherchabadindi.
riverse iteration avasaram lenappudu kokv _ 3 kii space-samarthavanthamaina pratyamnaayamgaa kokv _ 4 container c + + 11 kii jodinchabadindi.
aastulu.
coque _ 1, coque _ 2 mariyu coque _ 5 annee muulakaalaku vegavantamaina yaadruchchika praapyataku maddatu istayi. kokwais _ 3 dvidisaatmaka punaraavrutaaniki maddatu istundi, ayithe kokwais _ 4 ekadisaatmaka punaraavrutaaniki matrame maddatu istundi.
coque _ 1 moolakam choppinchadam ledhaa tolagimpuku maddatu ivvadu. coque _ 2 chivarilo vegavantamaina moolakam choppinchadam ledhaa tolagimpuku maddatu istundi. vector chivara laeni muulakaanni choppinchadam ledhaa tolaginchadam kosam choppinche sthaanam mariyu vector chivara madhya muulakaalanu coppy cheyalsina avasaram undhi. prabhaavita muulakaalaku punaraavruttulu eee vidhamgaa chellavu. vaastavaaniki, edainaa choppinchadam anni itaretarlanu chellanidigaa chestundi. alaage, kokwos _ 2 loe ketaayinchina nilva muulakaalanu choppinchadaaniki chaalaa chinnadi ayithe, kotta shreni ketayinchabadutundi, anni amsaalu coppy cheyabadataayi ledhaa kotta shreniki taralinchabadataayi mariyu paatha shreni vimukti pondutundi. coque _ 5, coque _ 3 mariyu coque _ 4 annee containerlo ekkadainaa muulakaalanu vaegamgaa choppinchadaaniki ledhaa tolaginchadaaniki maddatu istayi. kokwais _ 3 mariyu kokwais _ 4 atuvanti operationlo iteratorla chellubaatunu kaapaadutundi, ayithe kokwais _ 5 vaatannintinii chelladu chestundi.
vector.
coque _ 2 yokka muulakaalu pakkane nilva cheyabadataayi.<reifer paeru = "c + + 03 23.2.4/1"> anni dynamic shreni amalu maadirigaane, vektarlu takkuva memory viniyogam mariyu reifer mariyu dayta kaash viniyogam yokka manchi sthaanaanni kaligi untaayi. deck mariyu jaabitaalu vanti itara stl containerla maadirigaa kakunda, vektarlu container yokka prarambha saamarthyaanni suuchimchadaaniki viniyogadaaruni anumatistaayi.
vektarlu yaadruchchika praapyatanu anumatistaayi; antey, vector yokka oka muulakaanni shrenula muulakaala maadirigaane suuchimchavachchu (shreni suuchikala dwara). marovaipu, anusandhaaninchabadina jaabitaalu mariyu setlu yaadruchchika praapyata ledhaa pointer ankaganitaaniki maddatu ivvavu.
vector dayta nirmaanam nirdishta dayta nilvaku avasaramaina memarini twaragaa mariyu sulabhamgaa ketayinchagaladu mariyu idhi runa vimochana sthiramaina samayamlo alaa cheyagaladu. jaabitaanu erpaatu cheyadaaniki mundu podavu teliyakapovacchu conny tolagimpu (bahusha, chivaralo kakunda) arudugaa unna jaabitaalalo daetaanu nilva cheyadaaniki idhi pratyaekamgaa upayogapadutundi. vector nundi muulakaalanu tolaginchadam ledhaa vektarnu puurtigaa clear cheyadam valla aaa muulakamtoe anubandhinchabadina yea ghnaapakasaktini kooda khaalii cheyadu.
saamarthyam mariyu punarviniyogamu.
oka vilakshanhamaina vector amalu antargatamgaa, dynamicga ketaayinchina shreniki oka pointernu kaligi untundi mariyu bahusha vector yokka saamarthyam mariyu parimaanaanni kaligi unna dayta sabhyulanu kaligi untundi. vector parimaanam muulakaala vaastava sankhyanu suuchistumdi, ayithe saamarthyam antargata shreni parimaanaanni suuchistumdi.
kotta muulakaalanu choppinchinappudu, vector yokka kotta parimaanam daani saamarthyam kante peddadi ayithe, "reallocation" jarugutundi.<riff paeru = "c + + 03 23.2.4.3/1"> iso/iec (2003). "iso/iec 14882:2003 (ii): prograaming bhashalu-sii + + § 23.2.4.3 vector modifierlu [lib.vector.savarinchevi] "paeraa. 1 idhi saadhaaranamgaa vector kotta nilva praantaanni ketaayinchadaaniki, gatamlo unchina muulakaalanu kotta nilva praantaaniki taralinchadaaniki mariyu paatha praantaanni vidipinchadaaniki kaaranamavutundi.
eee prakriyaloo muulakaala chirunamalu marutayi kabatti, vektarlooni muulakaalaku sambandhinchina evaina suuchanalu ledhaa punaraavruttulu chellavu avtayi.<riff paeru = "c + + 03 23.2.4.2/5"> iso/iec (2003). "iso/iec 14882:2003 (ii): prograaming bhashalu-sii + + § 23.2.4.2 vector saamarthyam [lib.vector.saamarthyam] "paaraa. 5 chellani suuchananu upayoginchadam nirvachinchabadani pravartanaku kaaranamavutundi.
anavasaramaina punarviniyogaalanu nivaarinchadaaniki reserve () operation upayoginchavacchu. coll tuu reserve (enn) tarvaata, vector yokka saamarthyam kaneesam enn gaa untundani haamii ivvabadutundi.<riff paeru = "c + + 03 23.2.4.2/2"> iso/iec (2003). "iso/iec 14882:2003 (ii): prograaming bhashalu-sii + + § 23.2.4.2 vector saamarthyam [lib.vector.saamarthyam] "paaraa. 2 </reifer>
vector daani muulakaala yokka oka nirdishta kramaanni nirvahistundi, tadwara vector praarambhamlo ledhaa madhyalo oka kotta muulakaanni choppinchinappudu, tadupari muulakaalu vaati assainment operator ledhaa coppy constructor paramgaa venukaku taralinchabadataayi. tatphalitamgaa, choppinchina binduvu tarvaata muulakaalaku suuchanalu mariyu punaraavruttulu chellavu avtayi.<riff paeru = "c + + 03 23.2.4.3/3"> iso/iec (2003). "iso/iec 14882:2003 (ii): prograaming bhashalu-sii + + § 23.2.4.3 vector modifierlu [lib.vector.savarinchevi] "paeraa. 3 </reifer>
sii + + vektarlu design dwara memarini sthalamlo tirigi ketaayinchadaaniki maddatu ivvavu; i.ii.vektarnu tirigi ketaayinchina tarvaata, adhi kaligi unna memory ellappuduu daani elements coppy constructornu upayoginchi memory yokka kotta blacku coppy cheyabadutundi, aapai vidudala cheyabadutundi. vector saadaa paatha daetaanu kaligi unna sandarbhaallo idhi asamarthamgaa untundi mariyu nilva chesina memory block daati adanapu sannihita sthalam ketayimpu kosam andubaatulo untundi.
bool kosam pratyekata.
praamaanika library coque 36 kosam coque 2 template yokka specialisation nirvachistundi. eee specialisation yokka vivarana amalu muulakaalanu pyaak cheyaalani suuchistumdi, tadwara prati coque 36 oka bitt memarini matrame upayogistundi.<riff paeru = "c + + 03 23.2.5/1"> iso/iec (2003). "iso/iec 14882:2003 (ii): prograaming bhashalu-sii + + § 23.2.5 class vector <bool> [lib.vector.bool] "paaraa. 1 idhi porapatuga vistrutamgaa pariganinchabadutundi. c + + praamaanika library container kosam avasaralanu coque 38 teerchadu. udaaharanaku, oka kokwo 39 anedi kokwo 40 rakaniki chendinadi ayi undaali. idhi kokwo 41 vishayamlo kaadu, idhi kokwo kokwo marchagala proxy taragati. <reifer paeru = "c + + 03 23.2.5/2> iso/iec (2003). "iso/iec 14882:2003 (ii): prograaming bhashalu-sii + + § 23.2.5 class vector <bool> [lib.vector.bool] "paaraa. 2 adevidhamgaa, suuchimchanippudu coque 43 coque 44 nuu ivvadu. c + + praamaanika kamitee mariyu library working groupulo saadhaarana ekaabhipraayam undhi, coque 38 nii tolaginchi, taruvaata praamaanika library nundi tolaginchaalani, ayithe kaaryaacharana vaerae paerutoe tirigi pravesapettabadutundi.
jabita.
coque _ 3 dayta nirmaanam rettimpu anusandhaaninchabadina jaabitaanu amalu chestundi. dayta memarylo nirantaramgaa nilva cheyabadutundi, idhi jabita dayta nirmaanaanni jaabitaalo kotta muulakaalanu choppinchinappudu vektarlatho avasaramaina memarini tirigi ketayinchadanni nivaarinchadaaniki anumatistundi.
jabita dayta nirmaanam avasaramaina vidhamgaa memarini ketayistundi mariyu ketayistundi; anduvalla, idhi prastutam upayoginchani memarini ketaayinchadu. jabita nundi oka muulakaanni tolaginchinappudu ghnaapakasakti vimukti pondutundi.
jaabitaalo kotta amsaalanu choppinchetappudu jaabitaalu samarthavantamgaa untaayi; idhi oka operation. vectorla maadirigaa etuvanti shifting avasaram ledhu.
jaabitaalaku vectors (operation) vanti yaadruchchika-access saamarthyam undadu. jaabitaalo oka nodnu access cheyadam anedi access cheyalsina nodnu kanugonadaaniki jabita traversal avasaramayye operation.
chinna dayta rakaalato (intlu vantivi) memory ovar head vector kante chaalaa mukhyamainadi. prati node coque 47 nii teesukuntundi. pointerlu saadhaaranamgaa oka padam (saadhaaranamgaa 32-bitt operating systems kinda naalugu baitlu), antey naalugu bite puurnaamkaala jabita puurnaamkaala vector kante sumaru moodu retlu ekkuva memarini teesukuntundi.
forward jabita.
coque _ 4 dayta nirmaanam ontarigaa anusandhaaninchabadina jaabitaanu amalu chestundi.
deck.
coque _ 5 anedi oka container taragati template, idhi double-end kyooni amalu chestundi. idhi chaalaa operationlaku coque _ 2 maadirigaane ganana sanklishtatanu andistundi, mukhyamaina minahaayimputo idhi moolakam kramam yokka rendu chivarala nundi runa vimochana sthiramaina-samaya choppimpu mariyu tolagimpunu andistundi. coque _ 2 maadirigaa kakunda, coque _ 5 asambandhita memory blacklanu upayogistundi mariyu container yokka saamarthyaanni mariyu memarini tirigi ketayinche kshanaanni niyantrinchadaaniki etuvanti marganni andinchadu. coque _ 2 laaga, coque _ 5 yaadruchchika-access itaretarlaku maddatunu andistundi, mariyu muulakaalanu choppinchadam mariyu tolaginchadam anedi dekku anni itaretarlanu chelladu chestundi.
shreni.
coque _ 1 punarviniyogaparachaleni shrenini amalu chestundi. parimaanam compile-samayamlo template paramiti dwara nirnayinchabadutundi. design prakaram, container ketaayimpudaarulaku maddatu ivvadu endukante idhi praathamikamgaa sii-style arre rapper.
vidhula yokka avalokanam.
containerlu containerla paerla paeru meeda paeru pettabadina sheershikalalo nirvachinchabaddaayi, udhaa.zii. kokwais _ 2 sheershika kokwais _ _ nirvachinchabadindi. anni containerlu container concept yokka avasaralanu tiirustaayi, antey avi kokwais _ 58, kokwais _ 59, kokwais _ 60, kokwais _ 61, kokwais _ 62, mariyu kokwais _ 63 paddhatulanu kaligi untaayi.
sabhyula vidhulu.
jabita taragatilo bhaagamgaa itara karyakalapalu andubaatulo unnaayi mariyu c + + stl (algorithm (c + +)) loe bhaagamaina algorithamlu unnaayi, veetini cocewy _ 3 mariyu cocwy _ 4 taragatito upayoginchavachhuh
upayoginchadaaniki udaaharana.
eee krindi udaaharana vector mariyu sii + + praamaanika library algorithamlatho kuudina vividha paddhatulanu pradarsistundi, mukhyamgaa shuffling, sarting, atipedda muulakaanni kanugonadam mariyu erage-remove idiyamnu upayoginchi vector nundi cheripiveyadam.
// soulabhyam kosam ikkada upayoginchina, nijamaina karyakramalalo vivaekavamtamgaa upayoginchandi. 
namespace esteedeeni upayoginchadam;
intu maine ()
 arre arr {1,2,3,4};
 //shreni nundi vektarnu praarambhinchandi
 vector <int> sankhyalu (cbegin (arr), cend (arr));
 //vector loki marinni sankhyalanu choppinchandi
 sankhyalu.venakki nettandi (5);
 sankhyalu.venakki nettandi (6);
 sankhyalu.venakki nettandi (7);
 sankhyalu.venakki nettandi (8);
 //yaadrucchikamgaa muulakaalanu marchandi
 shaful (prarambham (sankhyalu), mugimpu (sankhyalu));
 //atipedda muulakaanni gurtinchandi, o (n)
 auto atipedda = garishta moolakam (cbegin (sankhyalu), cend (sankhyalu));
 cout "atipedda sankhya" * atipeddadi "\n";
 idhi suuchika vadda undhi" "dhooram (atipedda, cbegin (sankhyalu))" "\n"; 
 //muulakaalanu kramabaddheekarinchandi
 kramabaddheekarinchandi (prarambham (sankhyalu), mugimpu (sankhyalu));
 //vectorlo 5va sankhya yokka sthaanaanni kanugonandi 
 auto five = loyar _ bound (cbegin (sankhyalu), cend (sankhyalu), 5); 
 5va sankhya suuchika vadda undhi" "dhooram (aidu, cbegin (sankhyalu))" "'\n';
 4 kante ekkuva unna anni muulakaalanu tolaginchandi 
 sankhyalu.tolaginchandi (
 tolaginchandi (praarambhinchandi (sankhyalu),
 mugimpu (sankhyalu),
 [] (auto n) constexper {return n> 4;});
 //migilina anni sankhyalanu mudrinchandi
 kosam (const auto & element numbers)
 cout "moolakam";
avtput eee krindi vidhamgaa untundih

