DSA with Java.
Data structures and algorithms in Java — arrays, trees, graphs, dynamic programming, and coding interview patterns.
Beginner
Start here — no prior experience needed
Java Collections and Their Real Costs
Which collection to reach for and what each operation costs — plus the Integer cache, autoboxing overhead and the overflow that make Java's traps different from every other language's.
Arrays and Two Pointers
Opposite ends, same direction and fast-slow in Java — with the invariant that proves each correct, and the array-copy costs that do not exist in Python.
Hashing and Counting in Java
HashMap, merge and computeIfAbsent, why an int array beats a map for characters, and the autoboxing tax that makes Java counting slower than a plain array.
Sliding Window in Java
Fixed and variable windows, the shrink condition that decides which you have, and why substring inside a loop turns an O(n) algorithm back into O(n squared).
Stacks and Monotonic Stacks in Java
Why ArrayDeque replaced the synchronized legacy Stack, the next-greater-element pattern, and the amortised argument that makes a nested-looking loop O(n).
Intermediate
For developers with core concepts down
Linked Lists and Trees in Java
Reference rewiring without losing the tail, the dummy-head idiom, recursive versus iterative traversal, and the stack depth at which Java throws StackOverflowError.
Graphs in Java: BFS, DFS, and Topological Sort
Adjacency lists with Map and List, why BFS finds shortest paths on unweighted graphs, three-colour cycle detection, and Kahn's algorithm for ordering dependencies.
Sorting, Binary Search, and Heaps in Java
Comparator without subtraction overflow, the binary search bug that lived in the JDK for nine years, and PriorityQueue for top-k without sorting everything.
Advanced
Production-grade patterns for experienced engineers
Dynamic Programming in Java
Memoisation with int arrays rather than HashMap, bottom-up tables, the rolling-array space reduction, and long arithmetic where int silently overflows.
Backtracking in Java
The choose-explore-undo skeleton, why you must copy the path before adding it to results, pruning that turns hours into milliseconds, and duplicate handling.