C++ Deque rbegin()
C++ Deque rbegin() function returns a reverse iterator pointing to the last element of the container. An iterator can be incremented or decremented but it cannot modify the content of deque.
Where, rbegin() stands for reverse beginning.
Note: Reverse iterators are those which iterate from backwards and move towards the beginning of the deque.
It does not contain any parameter.
It returns a reverse iterator referring to the last element of a deque.
Let's see a simple example
5 4 3 2 1
In this example, rbegin() function reverses the content of deque by iterating from backwards and moving towards the beginning of the container.
Let's see a simple example when reverse iterator is incremented by one.
In this example, reverse iterator is incremented by one. Therefore, rbegin() function access the second element from backwards.