title: How can I calculate time complexity of this recursion algorithm
body: <p>How can I calculate time complexity of following piece of code? Suppose m is close to n. What I got is f(n) = 2*f(n-1). So time complexity is f(n) = O(2^n). Am I right?</p>
  
  <pre><code>int uniquePaths(int m, int n) {
      if (m &lt; 1 || n &lt; 1) return 0;
      if (m == 1 &amp;&amp; n == 1) return 1;
      return uniquePaths(m - 1, n) + uniquePaths(m, n - 1);
  }
  </code></pre>