Hot100: Same Tree (Synchronous Recursion / BFS ACERS Guide)

Subtitle / Summary The real challenge in LeetCode 100 is not “can you traverse a tree”, but “can you compare two trees node by node in lockstep”. This ACERS guide explains the synchronous-recursion contract, the queue-of-pairs BFS variant, and why the pattern matters in real engineering work. Reading time: 9-11 min Tags: Hot100, binary tree, DFS, BFS, tree comparison SEO keywords: Hot100, Same Tree, binary tree comparison, synchronous recursion, BFS, LeetCode 100 Meta description: A systematic guide to LeetCode 100 from synchronous recursion to pairwise BFS comparison, with engineering scenarios and runnable multi-language implementations. Target Readers Hot100 learners who want to build a stable “compare two trees together” template Developers who can write DFS on one tree but get confused once two trees must be checked in parallel Engineers who need structural-equivalence checks for config trees, component trees, or syntax trees Background / Motivation When many people first see LeetCode 100, the instinct is: ...

March 16, 2026 · 11 min · map[name:Jeanphilo]

Hot100: Invert Binary Tree (Recursion / BFS ACERS Guide)

Subtitle / Summary Invert Binary Tree looks tiny, but it is one of the fastest ways to test whether you really understand recursive structure on trees. This guide uses LeetCode 226 to break down the essence of “swap left and right subtrees”, covers both recursion and BFS, and shows how the same idea transfers to engineering scenarios. Reading time: 8-10 min Tags: Hot100, binary tree, recursion, BFS, tree transformation SEO keywords: Hot100, Invert Binary Tree, tree mirror, recursion, BFS, LeetCode 226 Meta description: Learn the recursive and BFS solutions for LeetCode 226, then extend the idea to layout mirroring and structural transformations. Target Readers Hot100 learners who want to verify whether they truly understand “apply recursion to every node in the whole tree” Developers who instinctively start traversing any tree problem, but are unsure when to process the current node Engineers who need tree mirroring, layout inversion, or symmetric structural transforms Background / Motivation The code for LeetCode 226 is usually very short, but the thinking pattern is extremely typical: ...

March 6, 2026 · 10 min · map[name:Jeanphilo]

Hot100: Maximum Depth of Binary Tree (DFS / BFS ACERS Guide)

Subtitle / Summary “Maximum depth” is one of the cleanest starting points for tree recursion. Once you truly understand that the answer for the current tree depends on the answers from its left and right subtrees, a whole family of tree DP and DFS problems becomes easier. This guide uses LeetCode 104 to explain recursive DFS, level-order BFS, and the engineering value of the same pattern. Reading time: 9-11 min Tags: Hot100, binary tree, DFS, BFS, recursion SEO keywords: Hot100, Maximum Depth of Binary Tree, DFS, BFS, LeetCode 104 Meta description: Learn the DFS and BFS solutions for LeetCode 104 from the definition of depth, with engineering mappings and runnable multi-language code. Target Readers Learners who are just starting tree problems and want to truly internalize “tree recursion return values” Developers who can write traversals but get confused once the task becomes “compute height”, “compute path”, or “compute an answer” Engineers who need depth analysis on hierarchical data such as menus, org charts, or nested JSON Background / Motivation LeetCode 104 looks like an easy problem, but it is almost the parent problem of tree recursion: ...

March 6, 2026 · 9 min · map[name:Jeanphilo]

Hot100: Binary Tree Inorder Traversal (Recursion / Stack ACERS Guide)

Subtitle / Summary Binary tree traversal is the starting point of most tree templates, and inorder traversal is one of the cleanest problems for understanding both recursive thinking and explicit stack simulation. This ACERS guide uses LeetCode 94 to explain the left-root-right order, the iterative stack template, and why the pattern matters in real engineering work. Reading time: 10-12 min Tags: Hot100, binary tree, DFS, stack, inorder traversal SEO keywords: Hot100, Binary Tree Inorder Traversal, inorder traversal, explicit stack, LeetCode 94 Meta description: A systematic guide to LeetCode 94 from recursion to explicit stacks, with engineering scenarios and runnable multi-language implementations. Target Readers Hot100 learners who want to lock in a stable tree-traversal template Developers moving from arrays and linked lists to trees, and still mixing up preorder, inorder, and postorder Engineers who want to reuse the left-root-right idea in BSTs, expression trees, or syntax trees Background / Motivation Inorder traversal is not hard by itself, but its training value is high: ...

March 6, 2026 · 11 min · map[name:Jeanphilo]

LeetCode 146: LRU Cache Design with O(1) Hash Map + Doubly Linked List

Subtitle / Summary This is not a memorization question. It is core cache-engineering practice: satisfy fast lookup and least-recently-used eviction at the same time, both in constant average time. We derive the optimal structure from naive approaches and provide runnable implementations. Reading time: 14-18 min Tags: LRU, hash map, doubly linked list, system design SEO keywords: LRU Cache, LeetCode 146, hash map, doubly linked list, O(1) Meta description: Build an LRU cache with hash map + doubly linked list to achieve O(1) average get/put, with engineering use cases, pitfalls, and six-language implementations. Target Readers LeetCode learners who want to master data-structure composition Backend/middleware engineers implementing local caches Interview candidates who know the answer headline but not the invariants Background / Motivation Caching trades space for time, but cache space is limited. When full, we must evict keys. LRU (Least Recently Used) assumes: ...

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

LeetCode 19: Remove Nth Node From End of List (One-pass Two Pointers) ACERS Guide

Subtitle / Summary The hard part is not deletion itself, but locating the predecessor of the nth node from the end in a singly linked list. This article derives the one-pass two-pointer solution from simpler baselines and explains correctness, boundaries, and engineering transfer. Reading time: 12-15 min Tags: linked list, two pointers, interview high frequency SEO keywords: LeetCode 19, Remove Nth Node From End of List, linked list, fast/slow pointers, dummy node Meta description: A complete ACERS walkthrough for removing the nth node from the end: from brute force to one-pass two pointers, with complexity, pitfalls, engineering scenarios, and Python/C/C++/Go/Rust/JS implementations. Target Readers Beginners building a stable template for linked-list interview problems Developers who know fast/slow pointers but still make boundary mistakes Backend/system engineers who want to transfer problem-solving templates to chain-structured data in production Background / Motivation “Remove the nth node from the end” is a classic medium-level linked-list problem. The challenge is usually not the delete operation itself, but: ...

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

LeetCode 138: Copy List with Random Pointer — A Complete Deep-Copy Breakdown

Subtitle / Abstract The real challenge in this problem is not traversing the list, but correctly cloning the cross-node reference relationships created by random pointers. This article moves from naive intuition to a hash-mapping solution, and explains why it is stable, maintainable, and practical in real engineering. Estimated reading time: 12–16 minutes Tags: Linked List, Deep Copy, Hash Table, Random Pointer SEO keywords: LeetCode 138, Copy List with Random Pointer, random list copy, deep copy, hash mapping Meta description: Perform deep copy of a random-pointer linked list via two passes plus a mapping table, with correctness, complexity, engineering practice, and six-language implementations. Target Readers Developers who feel shaky on random pointer problems while practicing LeetCode Learners who want to clearly understand “shallow copy vs deep copy” Engineers who want to transfer algorithmic thinking to real object-copy scenarios Background / Motivation For a normal linked list, copying val and next is straightforward. A random-pointer list adds one more pointer, random, which can: ...

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

LeetCode 2: Add Two Numbers from Naive to Optimal Carry Simulation

Subtitle / Summary This problem is just grade-school addition on a linked list: add one digit at a time, propagate carry, and append one final node if carry remains after both lists end. We move from naive ideas to the optimal one-pass solution, then map it to real engineering scenarios. Reading time: 12-15 min Tags: linked list, carry, simulation, LeetCode 2 SEO keywords: Add Two Numbers, LeetCode 2, reverse-order list, carry, dummy node Meta description: Use dummy + tail + carry to sum two reverse-order linked lists in O(max(m,n)) time, with common pitfalls, engineering analogies, and six-language runnable implementations. Target Readers Beginners building a stable template for linked-list problems Intermediate developers who often miss carry or boundary cases Engineers who want to transfer algorithmic thinking to stream-style data processing Background / Motivation This looks like an entry-level LeetCode problem, but it trains practical skills you will reuse: ...

February 11, 2026 · 14 min · map[name:Jeanphilo]

Hot100: Sort List Linked-List Merge Sort ACERS Guide

Subtitle / Summary LeetCode 148 is not about whether you can sort; it is about choosing the right sorting strategy for linked-list constraints. For singly linked lists, merge sort fits naturally: split by middle, sort recursively, merge linearly. Reading time: 12-16 min Tags: Hot100, linked list, merge sort, divide and conquer SEO keywords: Sort List, linked list merge sort, LeetCode 148, Hot100 Meta description: A practical ACERS guide for LeetCode 148 with derivation, complexity analysis, engineering mappings, and runnable code in multiple languages. Target Readers Hot100 learners building reusable linked-list templates Developers who struggle with split-and-reconnect pointer safety Engineers who want a clear answer to “why merge sort for linked lists” Background / Motivation Sorting linked structures appears in real systems: ...

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

Hot100: Merge K Sorted Lists Divide-and-Conquer O(N log k) ACERS Guide

Subtitle / Summary LeetCode 23 is a k-way merge problem, not just repeating LeetCode 21 in a loop. This ACERS guide derives the optimal structure, explains tradeoffs between divide-and-conquer and min-heap, and provides runnable implementations in multiple languages. Reading time: 12-16 min Tags: Hot100, linked list, divide and conquer, merge SEO keywords: Merge K Sorted Lists, LeetCode 23, divide and conquer, O(N log k), Hot100 Meta description: A full ACERS explanation of Merge K Sorted Lists from naive ideas to O(N log k) divide-and-conquer, with engineering mapping and multi-language code. Target Readers Hot100 learners who have finished LeetCode 21 and want the next-level merge template Developers who need predictable performance for k-way ordered data merge Engineers preparing for linked-list and divide-and-conquer interview rounds Background / Motivation This problem appears in many production forms: ...

February 10, 2026 · 11 min · map[name:Jeanphilo]