A personal project to build core Java data structures from scratch, to deeply understand DSA and Java internals.
This library re-implements popular collections like arrays, ArrayList, LinkedList, Stack, Queue, HashMap, Set, Tree, Heap, and more — from scratch. It’s designed for learning, practicing clean code, and building stuff.
-
add(value)
-
addAt(index, value)
-
removeAt(index)
-
remove(value)
-
find(value)
-
findBinary(value)
-
indexOf(value)
-
contains(value)
-
get(index)
-
set(index, value)
-
len()
-
isEmpty()
-
clear()
-
display()
-
bubbleSort()
-
selectionSort()
-
insertionSort()
-
max()
-
Unit Tests ✅
-
add(value)
-
display()
-
addAt(index, value)
-
removeAt(index)
-
remove(value)
-
removeAll(value)
-
find(value)
-
indexOf(value)
-
contains(value)
-
get(index)
-
set(index, value)
-
size()
-
isEmpty()
-
clear()
-
toArray()
-
iterator()
-
add(value)
-
addFirst(value)
-
addLast(value)
-
remove(value)
-
removeFirst()
-
removeLast()
-
find(value)
-
indexOf(value)
-
contains(value)
-
get(index)
-
set(index, value)
-
count()
-
isEmpty()
-
clear()
-
iterator()
-
push(value)
-
pop()
-
peek()
-
isEmpty()
-
count()
-
clear()
-
enqueue(value)
-
dequeue()
-
peek()
-
isEmpty()
-
count()
-
clear()
-
addFirst(value)
-
addLast(value)
-
removeFirst()
-
removeLast()
-
peekFirst()
-
peekLast()
-
isEmpty()
-
count()
-
clear()
-
add(key, value)
-
get(key)
-
remove(key)
-
containsKey(key)
-
containsValue(value)
-
keys()
-
values()
-
count()
-
isEmpty()
-
clear()
-
add(value)
-
remove(value)
-
contains(value)
-
count()
-
isEmpty()
-
clear()
-
add(value)
-
remove(value)
-
find(value)
-
contains(value)
-
traverseInOrder()
-
traversePreOrder()
-
traversePostOrder()
-
getMin()
-
getMax()
-
count()
-
isEmpty()
-
clear()
-
add(value)
-
poll()
-
peek()
-
isEmpty()
-
count()
-
clear()
- Make all collections generic
<T>
or<K,V>
- Implement
Iterable<T>
where needed - Add proper exceptions (
IndexOutOfBoundsException
, etc.) - Add JUnit tests for all
- Add JavaDocs for all classes & methods
- Make nice CLI banner (✅ already started!)
- Example
main()
for each structure
- AVL Tree or Red-Black Tree
- LRU Cache
- Thread-safe collections
- Serialization support
- Publish as a Maven/Gradle artifact
- Performance benchmarks vs.
java.util
Clone the repo and run your CLI banner:
javac -d out src/**/*.java
java MyCollectionsApp
This project is licensed under the MIT License — see the LICENSE file for details.
Ayoub El-mahjouby GitHub Profile