Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions src/data_structures/intro.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Java Data Structures

Java offers a wide array of data structures which are part of the Java Collections Framework. These data structures allow you to organize and store data in different ways, depending on your needs.

1. **Array**: This is the simplest data structure where data is stored in a linear, or one-dimensional, structure. Arrays are of fixed size and allow random access to elements.
2. **ArrayList**: Similar to an array but it is dynamic in size. It allows elements to be inserted or removed.
3. **LinkedList**: It is a linear data structure where elements are not stored in contiguous locations but are linked using pointers. It allows faster insertion and removal compared to an ArrayList.
4. **Stack**: This is a linear data structure that follows the LIFO (Last In First Out) principle. Operations like push (insertion), pop (removal) and peek (get the top element) are typically performed on a stack.
5. **Queue**: Another linear data structure that follows the FIFO (First In First Out) principle. Elements are added at the end and removed from the beginning.
6. **HashSet**: This is a collection that doesn't allow duplicate elements. It has no order of elements and doesn't allow null values.
7. **TreeSet**: This is a sorted collection that doesn't allow duplicate elements. It maintains ascending order.
8. **HashMap**: This is a structure that uses a hash function to map keys to values. It allows null keys and values.
9. **TreeMap**: This is a map implementation in the form of a tree structure. It maintains ascending order.

Understanding the characteristics of each data structure can help you choose the right one for your specific programming needs.