Shortest Path Core Trio: BFS, Dijkstra, and A* ACERS Engineering Breakdown

Subtitle / Abstract Shortest path is not one question. It is an engineering skill set: choose the right algorithm by graph conditions. This ACERS article breaks down BFS (unweighted) / Dijkstra (non-negative weights) / A (heuristic)* and gives optimization templates you actually use in relationship graphs, recommendation paths, and path explanations. Estimated reading time: 14-18 minutes Tags: Graph Theory, shortest path, BFS, Dijkstra, A* SEO keywords: shortest path, BFS, Dijkstra, A*, bidirectional search, multi-source BFS Meta description: Engineering guide to the shortest-path core trio: algorithm boundaries, complexity, runnable code, optimization strategies, and practical scenarios. Target Audience Learners reinforcing graph fundamentals who want reusable engineering templates Backend/algorithm engineers working on social links, recommendation paths, or graph-query explanations Developers who know BFS, Dijkstra, and A* by name but still struggle with robust selection and optimization Background / Motivation Shortest-path problems are common in: ...

February 9, 2026 · 15 min · map[name:Jeanphilo]

BFS / DFS Engineering Primer: k-hop Queries, Subgraph Extraction, and Path Existence ACERS Breakdown

Subtitle / Abstract BFS / DFS are not just about “being able to code them.” You need production-ready behavior, predictable cost, and provable correctness. Following the ACERS structure, this article breaks three common tasks (k-hop query, subgraph extraction, and path existence) into reusable templates: iterative implementation + early stop + visited structure selection. Estimated reading time: 12-16 minutes Tags: Graph, BFS, DFS, k-hop, subgraph extraction SEO keywords: BFS, DFS, k-hop query, subgraph extraction, path existence, visited bitmap, bloom filter Meta description: BFS/DFS for engineering scenarios: iterative implementations to avoid stack overflow, early stop to cut search cost, and visited bitmap/bloom to optimize memory and dedup performance. Target Audience Engineers working on graph databases, risk-control relationship graphs, or call-chain analysis Learners who can write “problem-solution style BFS/DFS” but do not yet have engineering templates Developers who want traversal code that is stable, observable, and extensible Background / Motivation In production systems, BFS/DFS is usually not a one-off offline script. It is part of an online request path: ...

February 9, 2026 · 15 min · map[name:Jeanphilo]

Hot100: Intersection of Two Linked Lists Two-Pointer Switch-Head O(1) Space ACERS Guide

Subtitle / Summary The key is not comparing values, but comparing node identity (same object / same address). This ACERS guide explains the naive hash approach, the length-alignment approach, and the most practical switch-head two-pointer template, with runnable multi-language implementations under the no-modification and no-cycle constraints. Reading time: 10-14 min Tags: Hot100, linked list, two pointers SEO keywords: Intersection of Two Linked Lists, switch heads, O(1) space, LeetCode 160 Meta description: Two pointers walk A then B and B then A, guaranteeing meeting at the intersection or both reaching null within m+n steps, with O(m+n) time and O(1) space. Target Readers Hot100 learners who want a reusable linked-list two-pointer template Developers who often confuse “same value” with “same node” Engineers working with shared tail structures in chain-like data Background / Motivation This problem looks simple, but it forces you to separate three concepts: ...

February 9, 2026 · 12 min · map[name:Jeanphilo]

Path Sum III: Prefix Sum + Hash Map Counting Downward Paths (LeetCode 437) ACERS Guide

Subtitle / Summary The constraint “the path can start anywhere, but must go downward” makes root-to-leaf DP insufficient. This ACERS guide explains prefix sums on trees: convert any downward path into a difference of two prefix sums, maintain a frequency hash map during one DFS, and finish in O(n). Reading time: 12–15 min Tags: binary tree, prefix sum, DFS, hash map SEO keywords: Path Sum III, tree prefix sum, prefix-sum hash, LeetCode 437 Meta description: Count downward paths whose sum equals targetSum in O(n) via prefix sum + hash map, with derivation, tradeoffs, and multi-language implementations. Target Readers LeetCode learners who want a reusable “tree + hash map” template People who tend to write O(n²) when the path does not have to start at the root Engineers working with hierarchical data (call traces, org trees) who need “downward segment” statistics Background / Motivation Many “tree path” problems hide a trap: you naturally assume paths start at the root, or end at leaves — but this problem allows the path to start and end at any nodes, as long as the direction is downward (parent → child). ...

February 4, 2026 · 15 min · map[name:Jeanphilo]

Hot100: Spiral Matrix (Boundary Shrinking Simulation ACERS Guide)

Subtitle / Summary Spiral traversal looks like “just printing in a fancy order”, but the real difficulty is getting boundaries and invariants right. This ACERS guide gives a reusable boundary-shrinking template and runnable multi-language solutions. Reading time: 12–15 min Tags: Hot100, matrix, simulation, boundary shrinking SEO keywords: Hot100, Spiral Matrix, clockwise traversal, boundary shrinking, LeetCode 54 Meta description: O(mn) spiral order traversal using boundary shrinking, with pitfalls, engineering scenarios, and runnable code. Target Readers Hot100 learners who want a reliable “matrix simulation” template Intermediate engineers who often get boundary cases wrong Anyone working with grids (visualization, raster data, path generation) Background / Motivation Matrix problems are notorious for being “easy to code, hard to get 100% correct”. One extra loop or one missed boundary check can break single-row/single-column cases or cause duplicated output. ...

February 3, 2026 · 13 min · map[name:Jeanphilo]

CNN, RNN, LSTM, and Transformer: Differences and When to Use Each

Using dependency path length and resource complexity, this article compares CNN, RNN, LSTM, and Transformer, and provides runnable examples plus a selection workflow.

January 26, 2026 · 23 min · map[name:Jeanphilo]

Hot100: Trapping Rain Water (Two Pointers O(n) ACERS Guide)

Subtitle / Summary Trapping Rain Water is the classic boundary-constraint problem. This ACERS guide explains the two-pointer method, key formulas, and runnable multi-language solutions. Reading time: 12–15 min Tags: Hot100, two pointers, array SEO keywords: Trapping Rain Water, two pointers, left right max, O(n), Hot100 Meta description: Two-pointer O(n) trapped water solution with engineering scenarios and multi-language code. Target Readers Hot100 learners building core templates Engineers handling capacity/volume constraints Anyone who wants a clean O(n) solution Background / Motivation Trapped water is a proxy for “capacity under boundary constraints.” It appears in cache headroom estimation, buffer overflow analysis, and terrain capacity modeling. The naive O(n^2) method is too slow; the two-pointer approach reduces it to O(n). ...

January 24, 2026 · 7 min · map[name:Jeanphilo]

Hot100: Maximum Subarray (Kadane O(n) ACERS Guide)

Subtitle / Summary Maximum Subarray is the classic 1D DP / greedy template. This ACERS guide explains Kadane’s idea, engineering use cases, and runnable multi-language solutions. Reading time: 10–12 min Tags: Hot100, dynamic programming, greedy SEO keywords: Maximum Subarray, Kadane, dynamic programming, O(n), Hot100 Meta description: Kadane O(n) maximum subarray sum with engineering scenarios and multi-language code. Target Readers Hot100 learners building stable templates Engineers analyzing peak segments in time series Anyone who wants a clean O(n) solution Background / Motivation Maximum subarray sum appears in P&L streaks, KPI lift windows, anomaly bursts, and throughput gains. The naive O(n^2) enumeration does not scale. Kadane’s algorithm solves it in one pass. ...

January 23, 2026 · 7 min · map[name:Jeanphilo]

LeetCode 1437: Check If All 1's Are at Least K Apart (ACERS Guide)

Subtitle / Summary A classic event-spacing validation model. This ACERS guide explains the one-pass logic, engineering use cases, and runnable multi-language solutions. Reading time: 10–12 min Tags: array, two pointers, event spacing SEO keywords: LeetCode 1437, event spacing, O(n) Meta description: One-pass validation for minimum spacing between 1s, with engineering use cases and multi-language code. Target Readers LeetCode learners building stable templates Engineers working on monitoring / risk control / behavior analytics Developers who need spacing or rate-limit validations Background / Motivation Many systems require events to be spaced apart: login failures, alarms, sensitive actions, API calls, etc. This problem maps directly to event spacing validation. A one-pass, O(1)-memory solution is ideal for real-time systems. ...

January 22, 2026 · 7 min · map[name:Jeanphilo]

LeetCode 231: Power of Two (Bit Trick O(1) ACERS Guide)

Subtitle / Summary A classic bit-manipulation template: determine if a number is a power of two in O(1). This ACERS guide covers the core insight, practical uses, and runnable multi-language implementations. Reading time: 8–12 min Tags: bit manipulation, binary, math SEO keywords: Power of Two, bit manipulation, binary, O(1), LeetCode 231 Meta description: O(1) power-of-two check using bit tricks, with engineering scenarios and multi-language code. Target Readers LeetCode learners building a bit-manipulation toolkit Backend / systems engineers who need alignment or capacity checks Anyone who wants stable O(1) integer tests Background / Motivation Power-of-two checks show up everywhere: hash table capacities, memory alignment, sharding, FFT window sizes. Looping or using floating-point logs is slower and prone to corner-case bugs. The bitwise method is fast, simple, and reliable. ...

January 21, 2026 · 6 min · map[name:Jeanphilo]