3 ms·
Let t(n, i) be a function where n is the number of recursive TREE calls and i is an integer. So t(1,3) = TREE(3) t(2,3) = TREE(TREE(3)) etc. Now you can do:
by umvi 7y ago
Let t(n, i) be a function where n is the number of recursive TREE calls and i is an integer.
So t(1,3) = TREE(3)
t(2,3) = TREE(TREE(3))
etc.
Now you can do:
t(TREE(3), 3)
or
t(t(t(t(t(t(t(t(t(TREE(3),3),3),3),3...)
- contravariant 7y agoThe way TREE grows it's very much possible that all these are inferior to simply f(n) = TREE(n+1).
- x3n0ph3n3 7y agoUnlikely since we are piping the output of TREE back into TREE, which is much larger than n+1.