Ok, i wrote 2 versions of this program. But im looking for the best solution - the most simple and fast one.
This is my solution but i was told that this solution is O(n*n) slower, which i dont know what really means. I was also told i could fasten it by breaking it into 2 functions, could anyone help me doing this?
void reverse3(char s[])
{
int l;
int i;
l = strlen(s);
if(l > 1)
{
reverse3(s + 1);
for(i = 1; i < l; i++)
{
int temp = s[i-1];
s[i-1] = s[i];
s[i] = temp;
}
}
}