Skip to main content
Journey Uncommon Logo
JourneyUncommon
hardKotlincontinuation-passing style transformSingle-choice MCQ

Because the CPS transform unwinds the JVM call stack at each suspension, what is the consequence for a deeply recursive chain of suspend calls compared with ordinary recursive functions?

suspend fun rec(n: Int): Int = if (n == 0) 0 else 1 + rec(n - 1)