Below is the list of Standard Data Structures provided in the Java Programming Langauge.
Array:
Array data structure is a fixed-size collection of elements of the same data type that can be accessed using index values. Arrays are efficient for accessing elements by index but inefficient for inserting or deleting elements in the middle of the array.
- Hierarchy: N/A
- Access Time (worst case): O(1)
- Search Time (worst case): O(n)
- Insertion Time (worst case): O(n)
- Deletion Time (worst case): O(n)
- Thread-safety: Not thread-safe
ArrayList:
ArrayList Data Structure is a dynamic array in Java that can grow or shrink during runtime.
- Hierarchy: List
- Access Time (worst case): O(1)
- Search Time (worst case): O(n)
- Insertion Time (worst case): O(n)
- Deletion Time (worst case): O(n)
- Thread-safety: Not thread-safe
LinkedList:
LinkedList is a data structure that stores a collection of elements, where each element has a reference to the next element in the list.
- Hierarchy: List
- Access Time (worst case): O(n)
- Search Time (worst case): O(n)
- Insertion Time (worst case): O(1)
- Deletion Time (worst case): O(1)
- Thread-safety: Not thread-safe
Stack:
Stack is a last-in, first-out (LIFO) data structure that allows elements to be pushed onto and popped off of the top of the stack.
- Hierarchy: List
- Access Time (worst case): O(n)
- Search Time (worst case): O(n)
- Insertion Time (worst case): O(1)
- Deletion Time (worst case): O(1)
- Thread-safety: Not thread-safe
Queue:
A queue is a linear data structure, based on FIFO (First In First Out) principle, elements are inserted from one end called the rear, and removed from the other end called the front.
- Hierarchy: List
- Access Time (worst case): O(n)
- Search Time (worst case): O(n)
- Insertion Time (worst case): O(1)
- Deletion Time (worst case): O(1)
- Thread-safety: Not thread-safe
PriorityQueue:
PriorityQueue is a data structure that orders elements based on their priority, which is determined by a Comparator or the natural ordering of elements.
- Hierarchy: Queue
- Access Time (worst case): O(n)
- Search Time (worst case): O(n)
- Insertion Time (worst case): O(log n)
- Thread-safety: Not thread-safe
Set:
Set data structure is a collection of unique elements that does not allow duplicate values.
- Hierarchy: N/A
- Access Time (worst case): N/A
- Search Time (worst case): O(log n)
- Insertion Time (worst case): O(log n)
- Deletion Time (worst case): O(log n)
- Thread-safety: Not thread-safe
HashSet:
HashSet is a very popular data structure in which the elements are stored using a hash table.
- Hierarchy: Set
- Access Time (worst case): O(1)
- Search Time (worst case): O(1)
- Insertion Time (worst case): O(1)
- Deletion Time (worst case): O(1)
- Thread-safety: Not thread-safe
TreeSet:
TreeSet is an ordered, sorted collection of data based mostly on the red-black tree data structure to maintain the elements in sorted order.
- Hierarchy: Set
- Access Time (worst case): O(log n)
- Search Time (worst case): O(log n)
- Insertion Time (worst case): O(log n)
- Deletion Time (worst case): O(log n)
- Thread-safety: Not thread-safe
Some more Data Structures from Java Collections Framework (up to Java 17)
EnumSet
ArrayDeque
ConcurrentHashMap
CopyOnWriteArrayList
CopyOnWriteArraySet
DelayQueue
EnumMap
IdentityHashMap
LinkedHashMap
LinkedBlockingDeque
LinkedBlockingQueue
PriorityBlockingQueue
TreeMap
WeakHashMap
ConcurrentSkipListSet
ConcurrentSkipListMap
ArrayBlockingQueue
BitSet
Provide Feedback For This Article
We take your feedback seriously and use it to improve our content. Thank you for helping us serve you better!
😊 Thanks for your time, your feedback has been registered!







Comments & Discussion
Facing issues? Have questions? Post them here! We're happy to help!