You are viewing a single comment's thread. Return to all comments →
Hey @Hitscotty! What will be the newLocation if you wish to do a right rotation?
right rotation : b[i] = a[(i-k)%n]
Right rotation can be done by changing the '-' sign..
Use [(n+k+i)%n] one in scan function.. and also it is useful to keep in mind ,1 right roation=(n-1)left rotation..