I have this algorithm:
n=3; 1
m=2; 2
func(int n, int m) 3
{
for(int i=1; i<=m; i++) 4
{
if(n>1) 5
{
func(n-1,m); 6
}
}
}
How can I find the time complexity of this one? I know that for the for loop I can write:
$$\sum_{i=1}^{m}c$$
But I don't know how can I write the recursion in this loop.
recLoop
defined? $\endgroup$func
seems to accept two arguments, but you only pass it one recursively $\endgroup$