Data Structures — Chapter 16

Upulie Handalage
1 min readJul 25, 2022



Sorting in Java can be easily done using tools for collecting and manipulating your data, without having to write your own sort algorithms. The Java Collections Framework’s data structure will help us achieve this.

Few important data structures from Java

  • ArrayList
  • TreeSet — Keeps the elements sorted and prevents duplicates.
  • HashMap — Let’s you store and access elements as name value pairs.
  • LinkedLis — Designed to give better performance when you insert or delete elements from the middle of the collection. (In practice, an ArrayList is still usually what you want)
  • HashSet — Prevents duplicates in the collection, and given an element, can find that element in the collection quickly.
  • LinkedHashMap — Like a regular HashMap, except it can remember the order in which elements (name/value pairs) were inserted, or it can be configured to remember the order in which elements were last accessed.



Upulie Handalage

Everything in my point of view. Here for you to read on....