The repository holds the implementation of many basic and advanced Data Structures and Algorithms in Java. Feel free to fork the repo and use it for Problem Solving or Competitive Programming or simply understanding and modifying the implementation.
- Binary Tree
- Graph Concepts
- Binary Heap
- Disjoint Union Set
- Tries / Prefix Tree
-
Binary Tree
- Building a Binary Tree from an Array.
-
Two Pointers
- Two Pointer approach for Rain Water Trapping problem
-
Graph Concept
- Making a Directed Graph
- Building a Weighted Directed Graph
- Computing Shortest Path - Dijkstra's with Min Heap (Optimised)
-
Disjoin Union Set
- Union by Size
- Path Compression
- Finding Connected Components
-
Trie / Prefix Tree
- Implementation
- Insertion, Search and Prefix Search
-
Binary Heap
- Binary Max Heap implementation
- Finding K most frequent elements
-
Fast IO for taking inputs in huge amount. Suited for Competitive Programming.
-
Helper Methods:
- A method which takes input a list of integers from the user and returns an array of integers.
S.No. | Problem Name | Link | Runtime | Tags |
---|---|---|---|---|
1. | House Robber III | View Problem | 5 ms | DP, Tree, DFS |
2. | Container with most water | View Problem | 5 ms | Two Pointers, Array |
3. | Course Schedule | View Problem | 3 ms | Graphs, DFS, Directed Graphs |
4. | Evaluate Division | View Problem | 8 ms | Graphs, DFS, Directed Graphs, Weighted Graphs |
5. | Number of Provinces | View Problem | 2 ms | Disjoint Union Set, Connected Components, Graph |
6. | Word Break | View Problem | 11 ms | Recursion, Dynamic Programming |
7. | Implement Trie | View Problem | 45 ms | Trie, Prefix Tree |
8. | Top K Frequent Elements | View Problem | 17 ms | Binary Max Heap |
9. | Network Delay Time | View Problem | 76 ms | Graph, Heap, Dijkstras Algorithm, Shortest Path |
All the DSA Problems' solution implements the Data Structures and Algorithms from this repo to achieve the above mentioned Runtime.