LearnFrenzy
Sign in Take a free test

HashMap and TreeMap · HashMap and TreeMap MCQ · Question 10

What floorKey returns Answer, explanation & discussion

  • MCQ
  • Medium
  • 0 comments
  • Answer explained
  • Moderated community
Question 10 Back to Exercise

For a TreeMap with keys 10, 20, 30, what does floorKey(25) return?

  • A 30
  • B 20 Correct
  • C 25
  • D null
Correct Answer: Option B

The greatest key ≤ 25. ceilingKey(25) would be 30.

Discussion & Comments 0

Share your method, a shortcut, or ask about a step you didn't follow.

No comments yet. Be the first to share your solution!

Post your comment

Comments appear after a quick review by our team.

Search LearnFrenzy

Esc

Quick links