STL (Standard Template Library):
STL provide a readymade set of
common classes for C++. The STL is general purpose classes (Data Structure) and
function (Algorithm) that could be used as a standard approach for storing data
and processing of data.
Components of STL –
1. Containers:
A
container is an object that store data. It is a way by which data is organised
in memory. The STL containers are implemented by template class and therefore
can be easily customized.
2. Algorithms:
An
algorithm is a procedure that is used to process the data contained in the
container. The STL includes many different kind of algorithm to provide support
to tasks such as initializing, searching, copying, sorting and merging.
Algorithms are implemented by template function.
3. Iterators:
An
iterator is an object that point to an element in a container. We can use
iterator to move through the contents of the container. Iterator can handle the
data of container. Iterator connect algorithm with container.
Application
of container class –
i.
Stack
ii.
Queue
iii.
Vector
iv.
DeQue
v.
List
vi.
Map
vii.
Multimap
viii.
Priority_Queue
0 comments:
Post a Comment