Tag
algorithms
7 articles tagged with “algorithms”
Binary Search: One Template That Solves Every Variant
Half-open [low, high) invariant, lower-bound and upper-bound, first/last occurrence, binary search on the answer, floating-point search, and the BCL helpers.
Sorting in 2026: Introsort, Stability, and When to Reach for Radix
.NET introsort vs LINQ stable OrderBy, comparator rules (never a - b), 0/1 vs unbounded knapsack-style iteration, counting sort, and external merge sort for data > RAM.
Recursion: When It's Elegant, When It's a Stack Overflow
Base/recursive/combine, memoization vs iteration, why .NET doesn't reliably tail-call optimize, and converting recursion to an explicit Stack<T> for adversarial depth.
Dynamic Programming: State, Recurrence, Base Case, Order
Top-down memoization vs bottom-up tables, coin change, 0/1 knapsack with reverse iteration, edit distance, LIS in O(n log n), and reconstructing the solution.
Trees: BSTs, Balance, and Why SortedDictionary Is Red-Black
BST vs self-balancing (red-black, AVL), B-trees in databases, heaps with PriorityQueue, tries for prefix queries, and iterative traversals that don't blow the stack.
Graph Traversal: BFS, DFS, Topological Sort, and the Visited Set
Adjacency list vs matrix, BFS for unweighted shortest path, DFS recursive vs iterative, Kahn's topological sort, three-colour cycle detection, and connected components.
Dijkstra in C#: PriorityQueue, A*, and Why Negative Edges Break It
Production Dijkstra with .NET PriorityQueue and the skip-stale pattern, path reconstruction, A* with admissible heuristics, multi-source variants, and Bellman-Ford for negatives.

