MCPcopy 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

2using namespace std;
3
4void 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
10string reverseWords(string s) {
11 int start = 0;

Callers 1

reverseWordsFunction · 0.70

Calls 1

swapFunction · 0.50

Tested by

no test coverage detected