Skip to content

Patterns

By patterns, I refer to common techniques or strategies used to solve problems in data structures and algorithms. These patterns help in recognizing problem types and applying appropriate solutions efficiently.

Common Patterns

Here are frequently used patterns in data structures and algorithms.

  1. Prefix Sum
  2. Two Pointers
  3. Sliding Window
  4. Fast and Slow Pointers
  5. Linked List Inplace Reversal
  6. Monotonic Stack
  7. Top 'K' Elements
  8. Quick Select
  9. Overlapping Intervals
  10. Modified Binary Search
  11. Binary Tree Traversal
  12. Depth First Search (DFS)
  13. Breadth First Search (BFS)
  14. Matrix Traversal
  15. Backtracking
  16. Dynamic Programming
  17. Binary Search