## 24.4.2 Transformations - `rotate`

- Less common algorithm
- `rotate` rotates a range around a specified point
- Divides sequence into 2 sections, then swaps sections
- E.g., rotate 1..10 around 7:

  > `vector<int> a(10);
  > generate(a.begin(), a.end(), SequenceGenerator(1));
  > vector<int>::iterator rotate_point
  > = find(a.begin(), a.end(), 7);
  > rotate(a.begin(), rotate_point, a.end());`

- Yields

  `7` | `8` | `9` | `10` | `1` | `2` | `3` | `4` | `5` | `6`

prev |top |next