4 ms·
It's equivalent to this recursive function, just change x2(n) to x(n, 2) and so on. // e is a power of two int mult(x, e) return e==1 ? x : mult(x, e/2
by sgustard 11y ago
It's equivalent to this recursive function, just change x2(n) to x(n, 2) and so on.
// e is a power of two
int mult(x, e)
return e==1 ? x : mult(x, e/2) + mult(x, e/2)
end