Write an efficient algorithm to reverse words in a given string or reverse a sentence without reversing the words. Note that handle the case if given string are start by space.
Input String: Programming C Learn To Ready You Are
Output String: Are You Ready To Learn C Programming
Input String: code to like you Are
Output String: Are you like to code
This function accept two parameters.
1) First index address of string
2) One stack double pointer
view given string in array.
View stack data.
Program for reverse a sentence without reversing the words in c. Time complexity O(n).
Execution Process Try it Yourself