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 12

Greedy Algorithms & Bit Manipulation

2 topics in 2 parts

Key ideas

Input Size (n) → Time (T) ↑ O(1) O(log n) O(n) O(n log n) O(n²) O(2ⁿ)
Greedy Algorithms & Bit Manipulation
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 2 topics in Greedy Algorithms & Bit Manipulation

  1. Greedy

    • Activity Selection & Intervals
  2. Bits

    • Bit Manipulation & XOR Tricks