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;
}