Oracle Interview Question

K - Rotate a word. e.g ABCDEF when 3-rotated will become DEFABC

Interview Answer

Anonymous

Aug 20, 2010

for the number of times rotation is required (i.e: N times), push each character starting from the end of the word into a Stack data structure. Then pop each character in the Stack into a StringBuffer and append the characters from word indexed 0 to (length - N)

1