Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/codemistic/Data-Structures-and-Algorithms
/ reverse
Function
reverse
String/reverseWordinString.cpp:4–8 ·
view source on GitHub ↗
Source
from the content-addressed store, hash-verified
2
using namespace std;
3
4
void reverse(string &s, int start, int end){
5
if(start>=end) return ;
6
swap(s[start],s[end]);
7
reverse(s,start+1,end-1);
8
}
9
10
string reverseWords(string s) {
11
int start = 0;
Callers
1
reverseWords
Function · 0.70
Calls
1
swap
Function · 0.50
Tested by
no test coverage detected