title: Time Complexity of a recursive Reverse String
body: <p>I want to find the Time complexity in Big O of the following code:</p>
  
  <pre><code>ReverseString(S,x,y)
  if x &lt; y
      swap(S,x,y)
      return ReverseString(S,x+1,y-1)
  </code></pre>
  
  <p>The equation I got was </p>
  
  <pre><code>T(1) = 1
  T(n) = 3 + T(n+1)+ T(n-1)
  </code></pre>
  
  <p>If I'm right how would I go about solving this.</p>
  
  <p>If I'm not right what is the correct equation.</p>