title: Recursion to dynamic function
body: <p>I'm trying to make dynamic function of recursive function and I'm a little bit stuck.</p>
  
  <p>Recursion:</p>
  
  <pre><code>static int F(int m, int n)
      {
          if(n == 0)
              return m;
  
          if (m == 0 &amp;&amp; n &gt; 0)
              return n;
  
          else
              return Math.Min((1 + F(m - 1, n)), Math.Min((1 + F(m, n - 1)), (D(m-1, n-1) + F(m - 1, n - 1))));
      }
  
      static int D(int i, int j)
      {
          Console.WriteLine("i:{0} | j:{1}", i, j);
          if (x[i] == y[j])
          {
              return 1;
          }
          return 0;
      }
  </code></pre>
  
  <p>Dynamic(all I have so far):</p>
  
  <pre><code>static int F2(int m, int n)
      {
          if (n == 0)
          {
              return m;
          }
          if(m==0 &amp;&amp; n &gt; 0)
          {
              return n;
          }
          else
          {
              //Math.Min((1 + F(m - 1, n)), Math.Min((1 + F(m, n - 1)), (D(m-1, n-1) + F(m - 1, n - 1))));
          }
      }
  </code></pre>
  
  <p><strong>And the question is can someone explain to me how do I convert this <code>Math.Min((1 + F(m - 1, n)), Math.Min((1 + F(m, n - 1)), (D(m-1, n-1) + F(m - 1, n - 1))));</code> code into dynamic? I'm kind of new with recursion.</strong></p>