given a vector of ints rotate it by an integer k
here the code
The GigaOM Show: Yahoo’s big moves, Xbox’s big One, HTC’s big problem
-
We break down the big Yahoo news, wonder if the new Xbox will break our
furniture and discuss whether HTC is broken beyond repair.
19 minutes ago
lets say the current size of vector is n+1
ReplyDeletethen
reverse (0,n)
reverse (0,n-k)
reverse (n-k+1,n)