Follow up question: instead of rotating the given array by one position, rotate it by m positions, m should be controlled by your program caller. if m is positive, it means rotating right, if m is negative, it
Time Complexity: O(n), wherenis the length of the array. Cyclically Rotate an Array by One Using Pointers Since the problem needs the last element to be placed at first, we can use 2 pointers that point to the first and last position of the array and start swapping. It involves the ...