QuestionQ132

VerifiedFunctions and Exceptions

What output is expected from the following code?

Question Image

Explanation

The base case returns 0. That value is multiplied through each recursive call, so traverse(2) evaluates to 0.

Community Discussion

No comments yet. Be the first to start the discussion!