std::rotate
The function `std::rotate` is part of the C++ Standard Library, specifically within the `algorithm` header. It rearranges the elements in a range by rotating them around a specified pivot point. This means that the elements before the pivot are moved to the end of the range, while the elements from the pivot onward are moved to the front.
To use `std::rotate`, you need to provide three iterators: the beginning of the range, the pivot iterator, and the end of the range. The function operates in linear time, making it efficient for large datasets. It is commonly used in algorithms that require cyclic permutations of data.