Skip to content

TreeMap in Java

This directory covers TreeMap, which is a Red-Black tree-based implementation of the NavigableMap and SortedMap interfaces, sorting keys automatically.

Lessons Map

  1. 01_Introduction.md: What is TreeMap? Introducing sorted map keys.
  2. 02_Why_TreeMap.md: Why do we need sorted keys in applications?
  3. 03_Creating_TreeMap.md: Syntax and natural/custom order comparators.
  4. 04_Adding_Elements.md: Appending entries using put().
  5. 05_Accessing_Elements.md: Safely accessing elements and null restrictions.
  6. 06_Updating_Elements.md: Modifying mapping values.
  7. 07_Removing_Elements.md: Removing elements and clearing the map.
  8. 08_Iteration.md: Iterating keys/values in natural sort order.
  9. 09_NavigableMap_Methods.md: Special range search APIs (floorEntry, ceilingEntry, etc.).
  10. 10_Internal_Working.md: Balanced binary search tree model.
  11. 11_Red_Black_Tree.md: Self-balancing invariants (color rules and rotations).
  12. 12_Comparison_with_HashMap.md: Computational lookup times.
  13. 13_Interview_Questions.md: TreeMap specific interview Q&As.

Back to Maps Home: Map Index