A structured collection of data structures and algorithms practice solutions in Java, organized by problem and topic. This repository documents my preparation through readable implementations, complexity analysis, and incremental problem solving.
| Topic | Examples |
|---|---|
| Arrays and strings | Searching, sorting, prefix techniques, sliding window, two pointers |
| Linked lists | Traversal, reversal, merging, cycle detection |
| Stacks and queues | Monotonic structures, parsing, scheduling patterns |
| Trees and graphs | Traversals, shortest paths, connectivity, recursion |
| Dynamic programming | Memoization, tabulation, subsequences, optimization |
| Greedy and binary search | Interval decisions, feasibility checks, optimization patterns |
| SQL practice | Selected database query problems where applicable |
Each problem is kept in its own folder with a descriptive name, the solution source file, and a problem explanation where available.
DSA/
├── <problem-number>-<problem-name>/
│ ├── README.md
│ └── <solution-file>.java
└── ...
From the problem directory:
javac Solution.java
java SolutionSome files use problem-specific class names. In that case, compile and run the class declared in the source file:
javac <file-name>.java
java <ClassName>Solutions prioritize correctness, clear naming, and an explicit time and space complexity trade-off. The collection is intentionally incremental: newer solutions may include multiple approaches, while earlier entries focus on building a reliable foundation.
This is a living practice repository. Problems are added as I work through interview patterns, strengthen Java fundamentals, and revisit solutions for clarity or optimization.