Master List, Set, Queue, Map and all collection interfaces with practical implementations
Theory Β· Practical Β· Get Started
- About
- Collection Hierarchy
- Projects
- Technologies
- Getting Started
- Learning Topics
- Contributing
- Contact
The Java Collection Framework provides a unified architecture to store and manipulate groups of objects. This repository offers both theoretical understanding and practical implementations to help you master collections in Java.
- π Performance - Choose the right data structure for optimal performance
- π Reusability - Pre-built implementations save development time
- π Algorithms - Built-in sorting, searching, and manipulation methods
- π― Interview Ready - Most asked topic in Java interviews
βββββββββββββββββββ
β Iterable β
ββββββββββ¬βββββββββ
β
ββββββββββΌβββββββββ
β Collection β
ββββββββββ¬βββββββββ
βββββββββββββββββββββΌββββββββββββββββββββ
β β β
βββββββββΌββββββββ ββββββββΌβββββββ ββββββββΌβββββββ
β List β β Set β β Queue β
βββββββββ¬ββββββββ ββββββββ¬βββββββ ββββββββ¬βββββββ
β β β
βββββββββββΌββββββββββ βββββ΄ββββ ββββββ΄βββββ
β β β β β β β
ArrayList LinkedList Vector HashSet TreeSet PriorityQueue Deque
βββββββββββββββββββ
β Map β (Separate Hierarchy)
ββββββββββ¬βββββββββ
βββββββββββββββββββββΌββββββββββββββββββββ
β β β
HashMap TreeMap LinkedHashMap
Comprehensive theoretical documentation covering:
| Topic | Description |
|---|---|
| Interfaces | Collection, List, Set, Queue, Map, Iterator |
| Classes | ArrayList, LinkedList, HashSet, TreeSet, HashMap |
| Algorithms | Sorting, Searching, Shuffling, Reversing |
| Comparators | Comparable vs Comparator interfaces |
Hands-on coding examples demonstrating:
| Implementation | What You'll Learn |
|---|---|
| List Operations | Add, remove, get, indexOf, subList |
| Set Operations | Union, intersection, difference |
| Map Operations | put, get, keySet, values, entrySet |
| Queue Operations | offer, poll, peek, priority ordering |
- Java JDK 8 or higher
- Any Java IDE (Eclipse/IntelliJ/VS Code)
# Clone the repository
git clone https://github.com/Shubh2-0/Collection-Framework.git
# Navigate to project
cd Collection-Framework
# Open in your IDE and explore!- β ArrayList - Dynamic arrays with fast random access
- β LinkedList - Doubly-linked list implementation
- β Vector - Synchronized dynamic array
- β HashSet - Unordered, no duplicates, O(1) operations
- β LinkedHashSet - Maintains insertion order
- β TreeSet - Sorted set using Red-Black tree
- β HashMap - Key-value pairs with O(1) average lookup
- β LinkedHashMap - Maintains insertion order
- β TreeMap - Sorted by keys using Red-Black tree
- β PriorityQueue - Elements ordered by priority
- β ArrayDeque - Double-ended queue implementation
- β LinkedList as Queue - FIFO operations
Contributions are welcome! Whether it's:
- π Adding new implementations
- π Fixing bugs
- π Improving documentation
- π‘ Suggesting new topics