Quantcast
Channel: Programming Forums
Viewing all articles
Browse latest Browse all 51036

uniform cost v/s logarithmic cost

$
0
0
can anyone explain me the time complexity of factorial function if we follow RAM model and if we follow logarithmic cost concept.

int fact(int N) {
j=1; prod=1;
while (j<=N) {
j=j+1; prod=prod*j;
}
return prod;
}


Viewing all articles
Browse latest Browse all 51036

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>