Dispatches in Data Structures and Algorithms
DSA
2026-06-14 • 5 min readHow Disjoint Set Union tracks dynamic connectivity in near-constant amortized time, when a Trie outperforms hash sets on string prefix queries, and how to read input bounds for complexity targets.
DSA
2026-06-05 • 5 min readHow converging two pointers and variable-length sliding windows compress nested subarray scans to linear time, why monotonicity decides which to use, and how to prevent backward left-pointer bugs.
DSA
2026-05-28 • 5 min readHow to choose between iterative level-order BFS and bottom-up recursive DFS on binary trees, why Lowest Common Ancestor simplifies in BSTs versus general binary trees, and common recursion bugs.
DSA
2026-05-20 • 5 min readHow monotonic stacks resolve next-greater and histogram area spans in linear time, why storing indices beats storing values, and when to swap the stack for a monotonic deque.
DSA
2026-05-12 • 5 min readWhy sentinel dummy heads remove head-pointer corner cases, how Floyd's tortoise-and-hare proof finds midpoints and cycle entry nodes, and how to rewire sublists cleanly in O(1) space.
DSA
2026-05-04 • 5 min readWhy bounded min-heaps find the K largest items faster than sorting, how two heaps balance running medians, and how Python heapq avoids tuple comparison crashes in K-way merges.
DSA
2026-04-26 • 5 min readHow complement lookup and prefix-sum hash maps turn quadratic array scans into single-pass linear solutions, when sorting beats hashing, and how negative numbers break sliding windows.
DSA
2026-04-17 • 5 min readHow to choose between multi-source BFS, 3-color DFS cycle detection, and Kahn's topological sort across grids and directed dependency graphs without duplicate queue pushes or missed cycles.
DSA
2026-04-09 • 5 min readA repeatable workflow for deriving 1D and 2D dynamic programming recurrences from overlapping subproblems, avoiding unbounded vs 0-1 loop direction bugs, and compressing 2D tables to 1D memory.
DSA
2026-04-01 • 5 min readHow to recognize monotonic feasibility predicates in interview prompts, lock down your binary search loop invariant so off-by-one bugs disappear, and use Python's bisect module effectively.