explanation for dinesh's algo.

let the sting is:arr[]="my name is kamakshi"
first reverse the whole string by swapping characters from beginning and end
strlen(arr)=19;
now process till 19/2=9

swap(arr[0].arr[strlen-1])
now swap (arr[1],arr[strlen-2]);
this way u will reverse the string in place.

now in this similar manner start reversing each word..






On Fri, Jul 22, 2011 at 11:42 AM, anonymous procrastination <
opamp1...@gmail.com> wrote:

> Heya,
> Someone please explain dinesh's approach with an example.
> I am not able to get the answer. Doing some mistake.
>
> --
> AP
>
> --
> 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
> algogeeks+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>
>


-- 
Regards,
Kamakshi
kamakshi...@gmail.com

-- 
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 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.

Reply via email to