Let's see how many times the recursion is called: you start with a long string and do those linear operations. To get the reversed tail of the string you do a recursion with one shorter string which is still pretty long, but luckily it's decreasing. You'll end up with linear operations being executed n + n-1 + n-2 + n-3 + ... + 3 + 2 + 1 which is (from lower education) = n * (n-1) / 2 and you have a char-char copy 3 times, so you end up with O(n^2).