Data Structures & Algorithms chapters
  1. 01Asymptotic Analysis & Complexity
  2. 02Arrays & Strings Algorithms
  3. 03Searching & Sorting Algorithms
  4. 04Linked Lists
  5. 05Stacks & Queues
  6. 06Recursion & Backtracking
  7. 07Binary Trees & BST
  8. 08Heaps & Priority Queues
  9. 09Hashing & Hash Tables
  10. 10Graphs & Graph Algorithms
  11. 11Dynamic Programming (DP)
  12. 12Greedy Algorithms & Bit Manipulation

Chapter 10

Graphs & Graph Algorithms

6 topics in 1 parts

Key ideas

Input Size (n) → Time (T) ↑ O(1) O(log n) O(n) O(n log n) O(n²) O(2ⁿ)
Graphs & Graph Algorithms
ApproachTime ComplexityAuxiliary SpaceKey Limitation
Brute Force ApproachO(N²) or O(2ᴺ)O(1) / MinimalTimes out on large constraints ($N > 10^4$)
Optimal ApproachO(N) or O(N log N)O(1) / O(N)Requires sorted invariant or hash set lookup
Theoretical Lower BoundΩ(N)O(1)Must inspect every element at least once

All 6 topics in Graphs & Graph Algorithms

  1. Graphs

    • Graph Representations
    • Breadth-First Search (BFS)
    • Depth-First Search (DFS)
    • Cycle Detection in Graphs
    • Dijkstra's Algorithm
    • Topological Sort & Kahn's Algorithm