LearnFrenzy
Sign in Take a free test

Data Structures in Java · Data Structures in Java MCQ · Question 10

The tree inside TreeMap and TreeSet Answer, explanation & discussion

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

Which self-balancing tree do TreeMap and TreeSet use internally?

  • A AVL tree
  • B B-tree
  • C Red-black tree Correct
  • D Splay tree
Correct Answer: Option C

The red-black colouring rules keep the height within about 2 log₂ n, so operations are O(log n).

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