5 ms·
It kind of depends on your definition of "naive" For instance one 'perfectly naive' implementation of F(n) would be: return 1.6 ^ n; or whatever your language
by Stormbringer 15y ago
It kind of depends on your definition of "naive"
For instance one 'perfectly naive' implementation of F(n) would be:
return 1.6 ^ n;
or whatever your language of choice's equivalent is (depending on your syntax)
- jrockway 15y agoVery few people know recursion. Even fewer people know math. So it's unlikely that this will ever happen. The goal is to determine whether or not the person knows that functions can call themselves. It then leads into a nice conversation about the efficiency of this particular algorithm. Answering "1.6 ^ n" will just lead to a similar-but-different question being asked, since this is not a math question.