Two pointers: turning O(n²) scans into one pass
Two indexes moving with a purpose can replace nested loops. The trick is knowing which pointer to move and why it is safe to skip what you skip.
WRITING / NOTES FROM THE FORGE
4 articles tagged Algorithms.
Two indexes moving with a purpose can replace nested loops. The trick is knowing which pointer to move and why it is safe to skip what you skip.
Once you see binary search as "find the first place a condition becomes true", a whole family of interview problems collapses into one template.
Graph algorithms every developer should know: when to use BFS, DFS, or Dijkstra, how each works, and correct Python code for routing and dependency problems.
Big O notation explained with real code: how to read O(1), O(log n), O(n log n) and O(n²), drop constants correctly, and reason about space as well as time.