| preferred AP College board partner for AP classes
AP Computer Science A/Unit 10: Recursion
Start Practice TestPractice Test
About Exam
medium Solved by 4 students
Evaluating a Recursive Method
< Prev
Next >

Consider the following recursive method coconut.

public int coconut(int k) {
  if (k == 1) {
    return 2;
  } else {
    return 2 * coconut(k - 1) + k;
  }
}

What value is returned as a result of the call coconut(4)?

A

17

B

34

C

26

D

14

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

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