title: Recursion vs Iteration in C#
body: <p>I was asked a question in a recent interview to write a recursive function to reverse a string and whether an iterative version is better than recursive one for this particular algorithm. I am not sure how the recursive solution is worse/better than iterative one. Can anyone help me understand this?</p>
  
  <p>Isn't the below code a tail recursive one?</p>
  
  <pre><code>public static string Reverse(string str)
  {
      return (str.Length &lt;= 1 ? str : str[str.Length - 1] 
            + Reverse(str.Substring(0, str.Length - 1)));
  }
  </code></pre>