Beginner Compilers & Programming Language Theory
Q30 / 100

What is tail call optimization (TCO)?

Correct! Well done.

Incorrect.

The correct answer is B) Replacing a tail-recursive call with a jump, reusing the current stack frame and enabling O(1) space recursion

B

Correct Answer

Replacing a tail-recursive call with a jump, reusing the current stack frame and enabling O(1) space recursion

Explanation

Tail call: the last action of a function is a call with no remaining work. TCO replaces call+return with a jump, reusing the stack frame. Enables recursion in place of loops without stack overflow. Mandated in Scheme, supported by Kotlin, optional in others.

Progress
30/100