2 ms·
Ah, this is definitely possible as well; you could statically analyze the function and then topologically sort the recursive calls. But that falls into an optim
by tylerhou 5y ago
Ah, this is definitely possible as well; you could statically analyze the function and then topologically sort the recursive calls. But that falls into an optimization category which requires some sophisticated analysis.
That type of optimization is trivial for fib, but it's really difficult in general. Also, it only easily works where the recursive parameter that is changing is an int/index. You could also make it work with trees/graphs, but that requires some substructural analysis...