I have a method like the following:
How can I calculate the Big-O?
O(2n) or O(nn)??
Thanks.
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 < len; i++) {
newStr = str.substring(0, i) + str.substring(i + 1);
combination(newStr, r);
}
}