You are viewing a single comment's thread. Return to all comments →
And here is my solution in C, avoiding any actual rotation and the time and possibly memory hit that would incur:
for (int j = 0; j < n; j++) { if (j+d < n) printf ("%d ",*(a+j+d)); else printf ("%d ",*(a+j-(n-d))); } printf("\n");
Seems like cookies are disabled on this browser, please enable them to open this website
Left Rotation
You are viewing a single comment's thread. Return to all comments →
And here is my solution in C, avoiding any actual rotation and the time and possibly memory hit that would incur: