4 ms·
Is it faster to start by doubling?
by yablak 2mo ago
Is it faster to start by doubling?
- emil-lp 2mo agoIt depends on F, but usually, if F is like 2^n, then a single F(i) for a too large i, is slower than computing F(j) for all j < i. This is illustrated by the fact that there are more leaves in a complete binary tree than all the other nodes summed.