Question PSC-FUNC-0058
MediumWhat will be printed by the following pseudocode?
Function hanoi(Integer n)
if (n == 0)
return 0
end if
return 2 * hanoi(n - 1) + 1
End Function
Print hanoi(5)
- A.
31
- B.
32
- C.
16
- D.
25
Sign up free to see the answer and a step-by-step explanation.