Referati. Konteynerlar


return 0; } #include #include #include using namespace std


Download 106.9 Kb.
bet3/3
Sana23.04.2023
Hajmi106.9 Kb.
#1390180
TuriReferat
1   2   3
Bog'liq
referat

return 0;
}

#include


#include
#include
using namespace std;
int main(){
array<int,5> a={15,8,9,45};
for(auto i=a.begin(); i!=a.end(); i++){
cout<<*i<<" ";
cout<cout<cout<cout<(a)<cout<}
return 0;
}


  1. Vector:

#include
#include
using namespace std;
int main(){
vector<int> tata, a={15,8,9,45,7};
int b=a.size();
for(int i=0; itata.push_back(a[i]);
}
cout<<"takrorlanishlar soni "<return 0;
}

#include


#include
using namespace std;
int main(){
vector tata, a={"Madina", "Eldor", "Asliddin"};
int b=a.size();
for(int i=0; itata.push_back(a[i]);
}
cout<<"takrorlanishlar soni "<return 0;
}

#include


#include
using namespace std;
int main(){
vector tata, a={"Madina ", "Eldor ", "Asliddin "};
int b=a.size();
for(int i=0; itata.push_back(a[i]);
}
tata.push_back("Samandar ");
cout<<"takrorlanishlar soni "<tata.erase(tata.begin()+1);
tata.pop_back();
for(auto i:tata){
cout<}
return 0;
}

3. Deque:


#include
#include
using namespace std;
int main(){
deque tata={5,6,7,4,2,6};
tata.push_back(45);
tata.push_front(15);
tata.push_front(95);
tata.push_front(70);
for(auto i:tata)
cout<return 0;
}

#include


#include
using namespace std;
int main(){
string b="Eldor";
deque talaba={"Ubaydulla","Eldor","Samandar","Asliddin","Muxammadjon","Zuxriddin"};
for(auto i:talaba)
if(b==i){
cout<}
else{
cout<<"Bunday ma'\lumot mavjud emas ";
}
return 0;
}

4. List:
#include


#include
using namespace std;
int main(){
list talaba={"Ubaydulla","Eldor","Samandar","Asliddin","Muxammadjon","Zuxriddin"};
talaba.remove("Samandar");
for(auto i:talaba)
cout<return 0;
}

5. Map:
#include


#include
using namespace std;
int main(){
map ab={{"olma ", 15},{"olcha ", 20}};
for(auto i:ab){
cout<cout<}
return 0;
}

6. Stack:


#include
#include
using namespace std;
int main() {
stack tata;
tata.push(5);
tata.push(10);
tata.push(18);
tata.push(25);
int a=tata.size();
for(int i=0;icout<tata.pop();
}
return 0;
}

7. Queue:


#include
#include
using namespace std;
int main() {
queue tata;
tata.push(5);
tata.push(10);
tata.push(18);
tata.push(25);
int a=tata.size();
for(int i=0;icout<tata.pop();
}
return 0;
}

#include


#include
using namespace std;
int main() {
priority_queue tata;
tata.push(5);
tata.push(10);
tata.push(18);
tata.push(25);
int a=tata.size();
for(int i=0;icout<tata.pop();
}
return 0;
}

#include


#include
using namespace std;
int main() {
priority_queue tata;
tata.push("Salom");
tata.push("Xayir");
tata.push("привет");
tata.push("пока");
int a=tata.size();
for(int i=0;icout<tata.pop();
}
return 0;
}

#include


#include
using namespace std;
int main() {
priority_queue tata;
tata.push("Salom");
tata.push("Xayir");
tata.push("привет");
tata.push("пока");
int a=tata.size();
for(int i=0;icout<tata.pop();
}
return 0;
}

Foydalanilgan adabiyotlar.
https://www.geeksforgeeks.org/

Download 106.9 Kb.

Do'stlaringiz bilan baham:
1   2   3




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling