DSA Topics
Every data structure, algorithm pattern, and foundation unit in the ASAPUtils DSA curriculum, with step-by-step visualizers and C++ plus JavaScript implementations.
Foundations
The state-simulation skill everything else sits on. Do these first, even though they look basic.
How to Read a Problem
The first five minutes of a coding interview decide the rest of it. A repeatable routine for parsing a problem, finding the constraints, working examples by hand, and identifying the pattern before you write any code.
Week 0
Big-O & Reading Constraints
Estimate time and space complexity in seconds, and use the input constraints to work out the target complexity before you have thought of an algorithm. The fastest way to know your idea is wrong.
Week 0
Loops, Indices & Pattern Printing
Nested loops, index arithmetic, and loop invariants — taught through star patterns and pyramids. This is the skill that later makes tree traversal, two pointers, and DP tables feel obvious instead of impossible.
Week 0
Recursion & the Call Stack
Recursion is a function that pauses itself. Learn to draw the call stack and the call tree, and to answer the one question that unlocks nearly every tree problem: what does this call return to its parent?
Week 0
Memory Model — C++ vs JavaScript
What a vector, an array, a hash map and a string actually are in memory, and how C++ and JavaScript differ. Knowing this is why "just use a hash map" stops being a magic phrase and starts being a trade you can price.
Week 0
Data structures
What each structure physically is, its invariant, and how you travel it.
Arrays
What an array actually is in memory, why appending is amortised O(1) but inserting is O(n), and the handful of signals that tell you the answer is a single pass rather than a nested loop.
Week 1
Strings
Strings are arrays of characters with one crucial difference between C++ and JavaScript — mutability. Frequency counting, character arithmetic, and the building trap that turns an O(n) loop into O(n squared).
Week 1
Hash Maps & Sets
The single highest-leverage data structure in interviews. What a hash map costs, why it turns O(n squared) scans into O(n) passes, and the exact phrases in a problem statement that should make you reach for one.
Week 1
Stack (LIFO)
Learn what a stack stores, why last-in-first-out order models nested work, and how push, pop, and top power parsing, undo, recursion, and monotonic-stack interview problems in C++ and JavaScript.
Week 3
Queue and Deque (FIFO)
Understand first-in-first-out queues and double-ended queues, their C++ and JavaScript implementations, and why BFS, level-order traversal, scheduling, and sliding-window algorithms depend on processing items in arrival order.
Week 3
Linked Lists
Learn singly and doubly linked lists as nodes connected by references, with pointer-safe traversal, dummy heads, insertion and deletion costs, C++ and JavaScript node models, and interactive link diagrams.
Week 5
Patterns
Signal → template → why it works. This is what makes an unseen problem solvable.
Two Pointers
Two indices walking a sorted array from opposite ends, discarding half the remaining possibilities at every step. The template is four lines — the part worth learning is the argument for why discarding is safe.
Week 1
Frequency Counting
Count first, then answer the question. The pattern behind anagrams, duplicates, top-k, and grouping — plus when a 26-slot array beats a hash map and when a canonical key beats both.
Week 1
Sliding Window (Fixed Size)
When the window size never changes there is no shrink loop — one element enters and one leaves on every step. The simpler half of the sliding window family, and the right place to start.
Week 2
Sliding Window (Variable Size)
Expand right always, shrink left while invalid, record when valid. One template covers longest-substring, character replacement, and minimum window — the only thing that changes is the definition of invalid.
Week 2
Prefix Sums
Precompute running totals so any range sum becomes one subtraction. The pattern that answers many range queries in O(1) each, and the one that rescues subarray problems when negative numbers break the sliding window.
Week 2
Monotonic Stack
Recognize next-greater, next-smaller, span, and histogram problems; learn the increasing and decreasing stack invariants; and understand why nested pop loops still run in O(n) across the full algorithm.
Week 3
Binary Search
Learn binary search through interval invariants, exact lookup and boundary templates, overflow-safe midpoint calculation, rotated arrays, virtual indexing, and common off-by-one failures in C++ and JavaScript.
Week 4
Binary Search on the Answer
Turn optimization problems into monotone feasibility checks, choose safe numeric bounds, and find the minimum feasible or maximum feasible answer with reusable C++ and JavaScript binary-search templates.
Week 4
Sorting and Comparators
Learn when sorting is the optimization, what ordering buys, stable versus unstable behavior, numeric and custom comparators in C++ and JavaScript, and the strict-order rules that prevent subtle interview bugs.
Week 4
Cyclic Sort and Index Placement
Learn the O(n), O(1)-space index-placement pattern for arrays containing values from 1 through n, including missing and duplicate variants, loop invariants, safe swaps, and C++ plus JavaScript templates.
Week 4
Fast and Slow Pointers
Master Floyd's fast-and-slow pointer pattern for cycle detection, cycle entrances, linked-list middles, and fixed gaps from the end, with proofs, C++ and JavaScript templates, and step-by-step traces.
Week 5
In-Place Linked-List Reversal
Learn the prev-curr-next reversal invariant for whole lists, sublists, and fixed-size groups, including safe pointer ordering, reconnection rules, C++ and JavaScript templates, and interactive link traces.
Week 5