Multiple choice technology programming languages

Which is the data structure used to store sorted map elements

  1. HashSet

  2. Hashmap

  3. Map

  4. TreeMap

Reveal answer Fill a bubble to check yourself
D Correct answer
Explanation

TreeMap implements the SortedMap interface and uses a red-black tree structure to store key-value pairs in sorted order. HashMap uses hashing (no sorting), HashSet is for unique elements (not key-value pairs), and Map is an interface.