"Matt" <jr********@hotmail.com> wrote in message
news:ba*************************@posting.google.co m...
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.
Matt,
You really are posting a series of classic interview/quizz questions
in comp.lang.c* groups. Some kind of homework ?
For this problem, a classic approach is to reverse the whole sentence,
then reverse the characters of each word. This has the advantage of
being easy to apply in-place.
Cheers,
--
http://ivan.vecerina.com