Reverse and Rotation of a String
Reverse operation is interchanging the position of characters of a string such that the first becomes the last, the second becomes the second last, and so on.
Consider a string “geeks”, now all possible rotations for this will be:
- geeks
- eeksg
- eksge
- ksgee
- sgeek
b) Reverse a String:
The reversing of a string is nothing but simply substituting the last element of a string to the 1st position of the string.
Contact Us