Another interesting point about the design of STL is that functions to sort, search or otherwise manipulate data are not member functions of the container classes. Algorithms perform actions such as sorting, searching, merging and the like. Containers manipulate groups of objects and the memory they require. Iterators are used to move through a container. Function objects encapsulate functions use by other parts of the library.
Adaptors provide an alternative interface to a component of the library.
A Simple Program Let's look at a simple simple test program using standard C-style arrays. In the above example, last1 and middle are iterators. Basically, the sample involves filling the container, shuffling the elements and then sorting them using the various sort algorithms. Similarly, one can use a vector container. A vector container is the closest thing to a C array.