Possible Duplicate:
Given an array of characters which form a sentence of words, give an efficient algorithm to reverse the order of the words (not characters) in it
For example if i give a input as "This is a string" I should get the output as "string a is This" I cant get any idea on how to do it