10 Questions
STL kutubxonasidagi konteynerlarning turlari qanday?
Uch turi: ketma-ketlik konteynerlari, assotsiativ konteynerlari va konteyner adaptorlari
Vektor konteynerining asosiy xususiyati nimani?
Dinamik o'lchami o'zgarishi mumkin
Algoritmlarning turlari qanday?
Uch turi: o'zgartiruvchi, o'zgarmas va sonli
Iterator kategoriyalarining turlari qanday?
Besh turi: input, output, forward, bidirectional va random access
STL kutubxonasida konteyner adaptorlari qanday?
Uch turi: stack, queue va priority_queue
Set konteynerining asosiy xususiyati nimani?
Tartibli elementlarga ega
Find algoritmi qanday?
Elementni joylashishini topadi
Iterator funksiyalarining turlari qanday?
Faqat ikkita turi: advance va distance
Sort algoritmi qanday?
Elementlarni tartibga soladi
Map konteynerining asosiy xususiyati nimani?
Kalitlar va qiymatlarga ega
Study Notes
STL Library
The Standard Template Library (STL) is a collection of generic containers, algorithms, and iterators in C++.
Containers
-
Sequence Containers:
-
vector
: a dynamic array that can grow or shrink in size -
deque
: a double-ended queue that allows efficient insertion and deletion at both ends -
list
: a doubly-linked list that allows efficient insertion and deletion at any position
-
-
Associative Containers:
-
set
: a sorted set of unique elements -
multiset
: a sorted set of elements that can have duplicates -
map
: a sorted associative container that maps keys to values -
multimap
: a sorted associative container that maps keys to values and allows duplicates
-
-
Container Adapters:
-
stack
: a last-in-first-out (LIFO) container -
queue
: a first-in-first-out (FIFO) container -
priority_queue
: a priority-based queue
-
Algorithms
-
Non-Modifying Algorithms:
-
find
: finds the first occurrence of a value in a range -
find_if
: finds the first occurrence of a value in a range that satisfies a predicate -
count
: counts the number of occurrences of a value in a range
-
-
Modifying Algorithms:
-
copy
: copies a range of elements to another range -
move
: moves a range of elements to another range -
sort
: sorts a range of elements in ascending order -
reverse
: reverses the order of a range of elements
-
-
Numeric Algorithms:
-
accumulate
: calculates the sum of a range of elements -
inner_product
: calculates the inner product of two ranges of elements
-
Iterators
-
Iterator Categories:
-
Input Iterator
: allows reading from a sequence -
Output Iterator
: allows writing to a sequence -
Forward Iterator
: allows reading and writing to a sequence in a forward direction -
Bidirectional Iterator
: allows reading and writing to a sequence in both forward and backward directions -
Random Access Iterator
: allows reading and writing to a sequence at any position
-
-
Iterator Functions:
-
advance
: advances an iterator to a specific position -
distance
: calculates the distance between two iterators
-
STL (Standard Template Library) - C++da konteynerlar, algoritmlar va iteratorlarning to'plami. Ushbu o'quv qo'llanmasida STLning turli komponentlari, ularning xususiyatlari va ishlatilishi tavsiflanadi.
Make Your Own Quizzes and Flashcards
Convert your notes into interactive study material.
Get started for free