Intermediate Compilers & Programming Language Theory
Q59 / 100

What is a trampoline in programming languages?

Correct! Well done.

Incorrect.

The correct answer is B) A runtime technique implementing mutual tail recursion by returning thunks (suspended computations) that a driver loop executes iteratively, avoiding stack overflow

B

Correct Answer

A runtime technique implementing mutual tail recursion by returning thunks (suspended computations) that a driver loop executes iteratively, avoiding stack overflow

Explanation

Trampoline: each tail call returns a thunk instead of calling directly. A loop executes thunks iteratively. Enables TCO in languages without native TCO (JVM, .NET). Space: O(1) per mutual tail call.

Progress
59/100