Programming interview questions and answers

Reverse words of a string without using stack

Write a program to reverse words of a string without using stack The approach:- Reverse the entire string. Scan the string from beginning. On reaching a word (space) reverse the sub string. Continue till end of the string. C++ program to reverse words of a string without using stack #include <iostream>#include <cstring>using namespace std;void reversestring(char* …

Reverse words of a string without using stack Read More »