25 Nov 2019

  • November 25, 2019
  • Amitraj
Components of Standered Template Library (STL)

The STL contains several components but at its core are 3 key components:-
    They are-

1. Container
2. Algorithm
3. Iterators


-> The Relatonship between The 3 STL components is:-







-> A Container is an object that actually stores data. it is a way data is organized in memory.
     The STL containers are implemented by Template classes and therefore can be easily customized to hold different types of data.


-> An Algorithm is a procedure that is used to process the data contained in the containers. The STL includes many different kinds of Algorithms to provide support to tasks such as Initializing, searching, sorting and merging. Algorithms are implemented by Template functions.


-> An Iterator is an object (like a pointer) that points to an element in a container. we can use iterators to move through the contents of container.
      Iterators are handled just like pointers. we can increment or decrement them. Iterators connect Algorithms with containers and play a key role in the manipulation of data stored in the containers.





























Translate

Popular Posts