2 ms·
a lot of CS undergrads compress out recursion knowledge. They learn that most recursion is best skipped in favor of iteration/dp, and they learn that they shou
by lumost 4y ago
a lot of CS undergrads compress out recursion knowledge. They learn that most recursion is best skipped in favor of iteration/dp, and they learn that they should implement things efficiently.
It’s possible the undergrad assumed you were referring to an efficient recursive algorithm or simply forgot most recursion.
- dhosek 4y agoNo, I was quite explicit, and seriously, is it really that hard to write something along the lines of if (i<=1) return i; else return factorial(i-1)*i; It wasn't meant to be a trick or trap, it was the simplest recursive function I could think of and it’s not like I was asking him to implement a stack.