Iterators form the bridge between algorithms and containers so that the former (which are generic) can work on the latter without having to know (be customized for) every container type possible.
hash_set is not a C++ standard-compliant container. So, you should not use it in any application that has portability listed as one of its requirements. Use std::map instead.
<algorithm> is the header that needs to be included for std::reverse() to be available.
std::transform() invokes tolower () for the characters in the string object that are within the bounds supplied to the transform function.
They do so because they are both template specializations of the template class std::basic_string.
The vector is a sequential container, and elements are stored and accessed in the very order that they are inserted.
The member function push_back() inserts elements at the end of the vector.
The member function size() returns the number of elements stored in a vector. Incidentally, this is true for all STL containers.
No. Insertion and removal of elements at the end of a vector are constant-time activities.
reserve() allocates space in the internal buffer of the vector, and insertion of elements does not need the vector to reallocate the buffer and copy existing contents. Depending on the nature of the objects stored in the vector, reserving space in a vector can result in performance improvements.