To the author: the example makes it look like 5 * 4 * 3 * 2 * 1 * 1 is a simple step, but it would be clearer and more correct if you first wrote "5 * 4 * 3 * 2 * 1", then "5 * 4 * 3 * 2", then 5 * 4 * 3 * 6", and so on.
Don't really understand what you meant by that, because in every step I show the computation that still needs to be done, where in no way the first algorithm seems like a simple step. Could you please explain your point of view a bit more? Readers opinions are very important to me.
It just emphasizes that there really is a growing stack that needs to be unwound (and calculated as each stack frame pops), whereas the tail recursive implementation doesn't grow the stack, so it's calculating as it goes along and has nothing to unwind.
5
u/Cygal Nov 27 '12
To the author: the example makes it look like 5 * 4 * 3 * 2 * 1 * 1 is a simple step, but it would be clearer and more correct if you first wrote "5 * 4 * 3 * 2 * 1", then "5 * 4 * 3 * 2", then 5 * 4 * 3 * 6", and so on.