Are you taking CLEP classes? Try clep.ai
| preferred AP College board partner for AP classes
AP Computer Science A/Unit 10: Recursion
Start Practice TestPractice Test
About Exam
medium Solved by 1 students

Tracing a Recursive Method

< Prev
Next >

Consider the following recursive method.

public static int baz(int k) {
  if (k <= 1) {
    return k;
  } else {
    return baz(k - 1) + baz(k - 2);
  }
}

What is the value returned by the call baz(6)?

A

8

B

13

C

34

D

5

Hint
Did You Know?
Explain Why
Explain All Answers
Check Answer
Show Correct Answer
Report Question
Mark for review

Question Leaderboard

Not enough data yet to show leaderboard.

No comments yet. Be the first to comment!

AI Tutor

How can I help?

APFIVE © 2020.
Email: apfive@apfive.org|Privacy Policy|