This repository is a collection of Java projects for brushing up on Data Structures, Algorithms and more!
The custom Data Structure and Algorithm Java classes are written with Generics. A Java class with Generics has a parameterized type which allows that Java class to use a different data type.
Example: The Java List class uses Generics to allow us to define a list of different Data Types.
List<String> listOfStrings = new ArrayList<>();
List<Integer> listOfIntegers = new ArrayList<>();
- Queue
- Stack
- HashSet
- HashMap
- Singly LinkedList
- Doubly LinkedList
- Circular Singly LinkedList
- Circular Doubly LinkedList
- Directed Graph
- Undirected Graph
- Binary Search Tree
- Binary Min Heap
- Binary Max Heap
- Linear Search
- Binary Search
- Selection Sort
- Insertion Sort
- Quick Sort
- Merge Sort
- Singleton
- Factory
- Pool
- Observer
- Command
- Math formulas for 2d and 3d shapes.
- Billing related (tips, discounts, commission, and etc).
- Statistics (i.e. mean, median, mode, min and max).
π― [custom-data-structure]/
The incomplete version to be used for practice and implementing on your own.
π― [custom-data-structure [complete]]/
The completed version to be used for reference.
π― [practice-algorithms]/
The incomplete version to be used for practice and implementing on your own.
π― [practice-algorithms [complete]]/
The completed version to be used for reference.
π― [design-patterns]/
The incomplete version to be used for practice and implementing on your own.
π― [design-patterns [complete]]
The completed version to be used for reference.
π― [practice-mathematics]/
The incomplete version to be used for practice and implementing on your own.
π― [practice-mathematics [complete]]/
The completed version to be used for reference.
Data Structure | Add/Insert | Remove/Delete | Access/Get | Search/Contains | Space Complexity |
---|---|---|---|---|---|
Array | O(n) | O(n) | O(1) | O(n) | O(n) |
Queue | O(1) | O(1) | O(n) | O(n) | O(n) |
Stack | O(1) | O(1) | O(n) | O(n) | O(n) |
HashSet | O(1) | O(1) | - | O(1) | O(n) |
HashMap | O(1) | O(1) | O(1) | O(1) | O(n) |
Singly LinkedList | O(1) | O(1) | O(n) | O(n) | O(n) |
Doubly LinkedList | O(1) | O(1) | O(n) | O(n) | O(n) |
Circular Singly LinkedList | O(1) | O(1) | O(n) | O(n) | O(n) |
Circular Doubly LinkedList | O(1) | O(1) | O(n) | O(n) | O(n) |
Binary Search Tree | O(log n) | O(log n) | O(log n) | O(log n) | O(n) |
Binary Min Heap | O(log n) | O(log n) | O(1) | O(n) | O(n) |
Binary Max Heap | O(log n) | O(log n) | O(1) | O(n) | O(n) |
Sort Algorithm | Best | Average | Worst | Space Complexity |
---|---|---|---|---|
Selection Sort | O(n^2) | O(n^2) | O(n^2) | O(1) |
Insertion Sort | O(n) | O(n^2) | O(n^2) | O(1) |
Quick Sort | O(log n) | O(log n) | O(n^2) | O(log n) |
Merge Sort | O(log n) | O(log n) | O(log n) | O(n) |