Both compute n!. On the left, n * factorial(n-1) leaves a multiplication pending, so every frame must stay alive and the stack reaches n+1 frames. On the right, the accumulator carries the product down and the recursive call is the last action. This simulation assumes tail-call optimisation, so a single frame is reused throughout. C++ permits this transformation but does not require it. Step through and compare the two heights.