Courses / Java Collections Framework
10. TreeMap Class
A map that is sorted according to the natural ordering of its keys or by a comparator provided at map creation.
1 min read Chapter 10 of 16
Java
TreeMap Class
A TreeMap is a map that keeps its keys in sorted order.
"I need to quickly find items in a sorted collection without losing track of their order."
A TreeMap is a part of Java's collection framework that stores key-value pairs in a sorted manner based on the natural ordering of keys or a specified comparator.
"I need to quickly find items in a sorted collection without losing track of their order."
A TreeMap is a part of Java's collection framework that stores key-value pairs in a sorted manner based on the natural ordering of keys or a specified comparator.