3 ms·
I first embraced recursion back in university when I realized that in certain situations, memory could "automatically" be allocated and deallocated by using the
by scj 12y ago
I first embraced recursion back in university when I realized that in certain situations, memory could "automatically" be allocated and deallocated by using the stack (Which is a nice short cut when learning C).
In time, this lead to an appreciation of recursion in terms of dynamic programming and code clarity. But I still believe that the best way to teach recursion is through appealing to students' lazy tendencies.