Vote count:
-2
I am trying to figure out the below two function But i couldn't able to get the answer
Function 1: By tylor serious
long long expo(int n,int x) {
long long sum = 1;
for(int i = n-1; i>0; --i)
sum = 1 + x * sum / i;
return sum;
}
Function 2:
long long exp(int a,int b) {
if( b == 0) return 1;
if( b % 2 ) return a * exp(a,b-1);
long long t = exp(a,b/2);
return t * t;
}
asked 36 secs ago
What is the Difference between the below two function?
Aucun commentaire:
Enregistrer un commentaire