You are viewing a single comment's thread. Return to all comments →
Array = {1,2,3,4,5} d = 4 Dosen't work for me
My Code :
for (int i = 0; i < a.Length; i++) { position = Math.Abs((i + (a.Length - d))% a.Length); newArray[position] = a[i]; }
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 →
Array = {1,2,3,4,5} d = 4 Dosen't work for me
My Code :
for (int i = 0; i < a.Length; i++) { position = Math.Abs((i + (a.Length - d))% a.Length); newArray[position] = a[i]; }