title: Complexity of string combination algorithm (as recursive)
body: <p>I have a method like the following:</p>
  
  <p>How can I calculate the Big-O?</p>
  
  <p>O(2<sup>n</sup>) or O(n<sup>n</sup>)??</p>
  
  <p>Thanks.</p>
  
  <pre class="lang-java prettyprint-override"><code>public static void combination(String str, int r) 
  {
  
      int len = str.length();
  
      if (len == r) myList.add(str);
      if (len == 1) return;
  
      String newStr = null;
      for (int i = 0; i &lt; len; i++) {
          newStr = str.substring(0, i) + str.substring(i + 1);
          combination(newStr, r);
      }
  }
  </code></pre>