You are viewing a single comment's thread. Return to all comments →
Another method for those who are concerned about manipulating existing array:
for(int i=1;i<n+1;i++) { if(i<=n-d) { cout<<a[(i+d)-1]<<" "; } else { cout<<a[(i-n+d)-1]<<" "; } }
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 →
Another method for those who are concerned about manipulating existing array: