Computer Science, asked by babukalluru03, 2 days ago

Which of the following statatement are true wort TreeMap? a TreeMap contains only unique keys b. TreeMap can contain duplicate keys. c TreeMap cannot have a null key d. TreeMap can have a null key e TreeMap maintains ascending order a f TreeMap maintains insertion order​

Answers

Answered by maya3227
0

Answer:

a. TreeMap contains only unique keys

c. TreeMap cannot have a null key

e. TreeMap maintains ascending order

Explanation:

a,c,e statements are true with Treemap.

Answered by manishad
0

Answer:

a) TreeMap contains only unique keys, c) TreeMap cannot have a null key and e) TreeMap maintains ascending order are true for TreeMap.

Explanation:

What is TreeMap:

  • The Java TreeMap class is based on a red-black tree. It allows you to store key-value pairs in sorted order quickly.

Features of TreeMap:

The following are the key features of the Java TreeMap class:

  1. The key determines the values in a Java TreeMap. It extends the AbstractMap class and implements the NavigableMap interface.
  2. Only unique elements are found in the Java TreeMap.
  3. There can't be a null key in a Java TreeMap, but there can be numerous null values.
  4. TreeMap in Java is not synchronised.
  5. Ascending order is maintained via Java TreeMap.
Similar questions