void leftRotatebyOne(int arr[], int n){
int temp = arr[0], i;
for (i = 0; i < n - 1; i++)
arr[i] = arr[i + 1];
arr[n-1] = temp;
}
Left Rotate Array by one
Cpp recipesThis code rotates the array left by one position.
0 Comments
Add Comment
Log in to add a comment