Contents Menu Expand Light mode Dark mode Auto light/dark, in light mode Auto light/dark, in dark mode Skip to content
DSA & Algorithms — Project Fortress
DSA & Algorithms — Project Fortress

00 · Command

  • The 9-Month DSA Fortress
  • Month-by-Month Execution Map
  • Sprint Calendar
  • North Star Artifacts
  • Weekly Rhythm
  • KPI Dashboard
  • Background Alignment
  • The Nine-Month Pitch

01 · Foundations Complexity

  • Phase 0 — Foundations & Complexity
  • Big-O Mastery
  • Recurrence Relations & the Master Theorem
  • Mathematical Thinking for DSA
  • Pseudocode and Problem-Solving Protocol
  • Phase 0 Exit Criteria & Projects

02 · Core Data Structures

  • Phase 1 — Core Data Structures
  • Arrays and Strings
  • Linked Lists
  • Stacks and Queues
  • Hash Tables
  • Heaps and Priority Queues
  • Phase 1 Exit Criteria and Projects

03 · Recursion and Trees

  • Phase 2 — Recursion, Trees & Divide-and-Conquer
  • Recursion Mechanics
  • Divide & Conquer
  • Binary Trees — Recursion Given Form
  • Binary Search Trees — Order From Structure
  • Backtracking — Exhaustive Search Done Right
  • Tries — Prefix Trees Built for Strings
  • Phase 2 Exit Criteria & Projects

04 · Graphs and Search

  • Phase 3 — Graphs & Search
  • Graph Fundamentals — The Language of Connections
  • BFS and DFS — The Two Traversals That Power Everything
  • Topological Sort — Ordering Dependencies
  • Shortest Paths — Getting There With Minimum Cost
  • Union-Find (Disjoint Set Union) — Dynamic Connectivity
  • Minimum Spanning Trees — Connecting Everything at Minimum Cost
  • Phase 3 Exit Criteria & Projects

05 · Dynamic Programming

  • Phase 4: Dynamic Programming
  • DP Foundations: The Two Pillars and Five Questions
  • 1D and Linear DP
  • 03 — 2D Grid & String DP
  • 04 — Knapsack Patterns
  • 05 — Interval DP & Subsequence DP
  • 06 — Tree DP & Bitmask DP
  • 07 — DP Pattern Recognition
  • 08 — Phase 4 Exit Criteria & Projects

06 · Advanced Algorithms

  • Phase 5 — Advanced Algorithms & Data Structures
  • 01 — Segment Trees
  • 02 — Fenwick Trees (Binary Indexed Trees)
  • 03 — Greedy Algorithms
  • 04 — Bit Manipulation
  • 05 — String Algorithms
  • 06 — Advanced Sorting & Search
  • 07 — Phase 5 Exit Criteria & Projects

07 · Competitive Mastery

  • Phase 6 — Competitive Mastery
  • Contest Strategy
  • 02 — Pattern Recognition at Speed
  • 03 — Reading Editorials Correctly
  • 04 — Stress Testing and Debugging
  • 05 — Template Library
  • 06 — Deliberate Practice Protocol
  • 07 — Exit Criteria and Final State

09 · Resources

  • 09 — Resource Canon
  • 01 — Books
  • 02 — Courses
  • 03 — Problem Banks
  • 04 — Visualizers and Learning Tools
  • 05 — Papers and Reference Materials
  • Phase-to-Resource Master Map

10 · Communities

  • 10 — Communities
  • Online Communities
  • YouTube Channels
  • Blogs and Newsletters
  • India-Specific Context

11 · Tools Setup

  • 11 — Tools Setup
  • IDE and Development Environment
  • Problem Tracking
  • Competitive Programming Setup
  • Day 1 Checklist — August 1, 2026

12 · Portfolio

  • Portfolio Ladder — Public Proof-of-Work
  • Portfolio Ladder — Master Reference
  • Rung 1 — Complexity Audit Repository
  • Rung 2 — Data Structure Library from Scratch
  • Rung 3 — “Explain the Algorithm” Blog Series
  • Rung 4 — LeetCode 100 Hard Milestone
  • Rung 5: Graph Algorithm Showcase
  • Rung 6: Dynamic Programming Pattern Handbook
  • Rung 7: Codeforces Rating ≥ 1200 (Newbie → Pupil)
  • Rung 8: The M9 Capstone

13 · Discipline

  • 13 — Discipline
  • 01 — Sprint Cadence
  • 02 — Lab Notebook
  • 03 — Benchmark Hygiene
  • 04 — Daily Practice
  • 05 — Teach to Learn
  • 06 — Failure Modes
  • 07 — Motivation Sustainment
  • 08 — Health, Burnout, and the Permission Slip
  • 09 — Interview and Assessment Conversion

99 · Pre Mortem

  • 99 — Pre-Mortem: The Adversarial Lens
  • Pre-Mortem 01 — The AI Crutch
  • Pre-Mortem 02 — Topic Skipping
  • Pre-Mortem 03 — The Memorizer Trap
  • Pre-Mortem 04 — The Plateau Grind
  • Pre-Mortem 05 — Motivation Collapse
  • Pre-Mortem 06 — Scope Creep
  • Pre-Mortem 07 — Isolation Degradation
  • Pre-Mortem 08 — Life, Health, and Family
  • 09 — Summary and Reset Protocol
Back to top

Phase 3 — Graphs & Search¶

Weeks 18–24 | November 30, 2026 – January 11, 2027

Every useful data structure you’ve learned so far is a special case of a graph. A linked list is a directed graph with in-degree ≤ 1 everywhere. A tree is a connected acyclic undirected graph. A BST is a rooted tree with an ordering constraint. Graphs are the general form of all of them, which is why mastering graphs means your earlier intuitions transfer and extend rather than getting replaced.

The fear people bring into this phase is usually: “there are so many algorithms.” There are, but most of them are BFS or DFS with one additional idea layered on top. Dijkstra is BFS on a priority queue. Topological sort is DFS with a finish-time stack. Kruskal’s MST is a sorted edge scan using Union-Find. Once you see those as BFS/DFS + bookkeeping, the phase becomes manageable.

The hard part isn’t memorizing the algorithms. It’s learning to model problems as graphs in the first place. That skill — “this problem is a graph in disguise” — is what separates candidates who reliably ace graph interviews from those who only succeed when the graph structure is handed to them explicitly.


Why Graphs Matter¶

Graphs appear in:

  • Dependency systems: build tools, package managers, course prerequisites

  • Network routing: IP routing tables, shortest path in maps

  • Social networks: friend recommendations, influence propagation

  • State machines: game states, parsing, compiler flow analysis

  • Grid problems: flood fill, island counting, maze solving — grids are implicit graphs

If you can model a problem as a graph and apply the right traversal, you’ve reduced a novel problem to a solved one. That’s the leverage.


Common Fear Points (With Honest Responses)¶

“There are too many algorithms.” You need to own 6: BFS, DFS, Dijkstra, Union-Find, Topological Sort, and either Kruskal’s or Prim’s for MST. Everything else is derived from these.

“I don’t know when to use which algorithm.” The algorithm choice follows from what you need: shortest path in unweighted graph → BFS. Shortest path with positive weights → Dijkstra. Dynamic connectivity → Union-Find. Linear ordering of dependencies → Topological Sort. After enough problems, the mapping becomes reflexive. The reference table below is your scaffold until then.

“Graph code has too many details.” Graph code is verbose because you’re managing: the graph structure, the visited set, and whatever state you’re computing. None of these is hard individually. The discipline is keeping them separate in your head. Read each algorithm file once carefully, implement it once from scratch, and the details compress into muscle memory.


Algorithm Reference Table¶

Algorithm

Use Case

Time Complexity

Space

Common Mistake

BFS

Shortest path, unweighted; level-order

O(V + E)

O(V)

Single BFS misses disconnected components

DFS

Connected components, cycle detection, topological sort

O(V + E)

O(V)

Directed cycle detection needs 3-color, not just visited

Dijkstra

Shortest path, non-negative weights

O((V+E) log V)

O(V)

Fails silently on negative edge weights

Bellman-Ford

Shortest path with negative edges, negative cycle detection

O(V × E)

O(V)

V-1 iterations, not V; inner loop over all edges

Floyd-Warshall

All-pairs shortest path

O(V³)

O(V²)

DP update order: k (intermediate) in outermost loop

Union-Find

Dynamic connectivity, MST (Kruskal)

O(α(n)) amortized

O(V)

Forgetting to do both path compression AND union by rank

Topological Sort

DAG ordering, dependency resolution

O(V + E)

O(V)

If not all V in result, graph has a cycle

Kruskal’s MST

Minimum spanning tree

O(E log E)

O(V)

Not sorting edges first

Prim’s MST

Minimum spanning tree (dense graphs)

O((V+E) log V)

O(V)

Not updating priority queue when shorter path found


What You’ll Have at the End of This Phase¶

By the end of Week 24 you can:

  • Look at a problem description and identify within 3 minutes which graph algorithm is relevant

  • Implement BFS, DFS, Dijkstra, Union-Find, and Topological Sort from scratch without reference, under timed conditions

  • Debug graph code by reasoning about the traversal state, not just re-reading the algorithm

  • Model non-obvious problems (word ladder, number of islands, course schedule) as graphs before writing any code

  • Distinguish between directed and undirected cycle detection without confusing the techniques


File Navigation¶

File

Content

01 — Graph Fundamentals

Representations, terminology, traversal invariants

02 — BFS and DFS

Deep dive on both traversals, all applications

03 — Topological Sort

Kahn’s + DFS-based, DAG properties, cycle detection

04 — Shortest Paths

Dijkstra, Bellman-Ford, Floyd-Warshall, 0-1 BFS

05 — Union-Find

DSU with path compression + union by rank

06 — Minimum Spanning Trees

Kruskal’s and Prim’s with full derivations

07 — Exit Criteria & Projects

Measurable exit gates, 3 projects, weekly schedule


Navigation¶

← Previous Phase

Phase 2 — Recursion, Trees & D&C

⌂ Root

Master README

Next
Graph Fundamentals — The Language of Connections
Previous
Phase 2 Exit Criteria & Projects
Copyright ©
Made with Furo
On this page
  • Phase 3 — Graphs & Search
    • Why Graphs Matter
    • Common Fear Points (With Honest Responses)
    • Algorithm Reference Table
    • What You’ll Have at the End of This Phase
    • File Navigation
    • Navigation