Big-O of recursive functions

1
2
3
4
5
6
int pow(int N, int p){
    if(p==0)
        return 1;
    else
        return N*pow(N,p-1);
}

The function int pow(int N, int p) , given above, runs in _ _ _ _ _ __ .

O ( log 10 n ) O(\log_{10}{n}) O ( n ) O(n) O ( n log 10 n ) O(n \log_{10}{n}) O ( 1 ) O(1)

This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try refreshing the page, (b) enabling javascript if it is disabled on your browser and, finally, (c) loading the non-javascript version of this page . We're sorry about the hassle.

0 solutions

No explanations have been posted yet. Check back later!

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...