Reverse the whole string first.
Then reverse every word.

On 10/31/07, Somesh Jaiswal <[EMAIL PROTECTED]> wrote:
>
> Hi,
>
> I was asked a question in an interview to Reverse the order of words in a
> sentence.
> eg. "Google is an awesome place to work"  should be reversed as "work to
> place awesome an is Google"
> The solution should be efficient and shouldn't use any extra memory.
>
> Pl suggest me some solution.
>
> Regards,
> Somesh
>
> >
>


-- 
Hongcheng Zhu

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to algogeeks@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/algogeeks
-~----------~----~----~----~------~----~------~--~---

Reply via email to