Arrays: Left Rotation

  • + 0 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]; }