You are viewing a single comment's thread. Return to all comments →
This one is very good but, for the case when k is much more bigger than n it is not working, because an arrayoutofboundException will occure.
maybe this will help
if (m-k%n < 0) { posValue = m-k%n+n; } else posValue = m-k%n; System.out.println(a[posValue]);
Seems like cookies are disabled on this browser, please enable them to open this website
Circular Array Rotation
You are viewing a single comment's thread. Return to all comments →
This one is very good but, for the case when k is much more bigger than n it is not working, because an arrayoutofboundException will occure.
maybe this will help