Kompyuter injenering kafedrasi Kompyuter injenering fakulteti Sirtqi “Ma'lumotlar tuzilmasi va algoritmlar” fanidan




Download 1,27 Mb.
bet5/5
Sana23.01.2024
Hajmi1,27 Mb.
#144058
1   2   3   4   5
Bog'liq
Nishonov Ma\'lumotlar tuzilmasi va algoritmlar 1-chi Mus

_dek1;"> #include Deque dek1;


Dek ustida bajariladigan amallar:

      • boshidan element kiritish. Push_front()

      • Oxiridan element kiritish. Push_back()

  • boshidan element chiqarish. pop_front()

  • oxiridan element chiqarish. Pop_back()

  • Empty() – bo’shlikka tekshirish.

Dekka oid misol keltiramiz: #include #include
int main (){
std::deque mydeque (2,100); // two ints with a value of 100 mydeque.push_front (200);
mydeque.push_front (300); std::cout << "mydeque contains:";
for (std::deque::iterator it = mydeque.begin(); it != mydeque.end();

++it)
}
std::cout << ' ' << *it; std::cout << '\n';
return

Natija:
300 200 100 100

Download 1,27 Mb.
1   2   3   4   5




Download 1,27 Mb.

Bosh sahifa
Aloqalar

    Bosh sahifa



Kompyuter injenering kafedrasi Kompyuter injenering fakulteti Sirtqi “Ma'lumotlar tuzilmasi va algoritmlar” fanidan

Download 1,27 Mb.