You are viewing a single comment's thread. Return to all comments →
Here's my in-place function implementation:
public static int[] arrayLeftRotation(int[] a, int n, int k) { // Rotate in-place int[] temp = new int[k]; System.arraycopy(a, 0, temp, 0, k); System.arraycopy(a, k, a, 0, n - k); System.arraycopy(temp, 0, a, n - k, k); return a; }
Seems like cookies are disabled on this browser, please enable them to open this website
Arrays: Left Rotation
You are viewing a single comment's thread. Return to all comments →
Here's my in-place function implementation: