Uses maximum-subarray problems to explain subproblems defined by subarrays ending at a specific position.
67 articles
Uses maximum-subarray problems to explain subproblems defined by subarrays ending at a specific position.
Derive the 2D dynamic-programming state, recurrence, and operation-order optimization for edit distance from its recursive subproblems.
Dynamic programming can recover a concrete optimal solution, not only an objective value. This article uses House Robber and longest common subsequence to show how a back array reconstructs the solution.
Uses longest common subsequence to explain two-dimensional subproblems, recurrences, and space optimization.
Uses House Robber to derive four steps for defining subproblems, recurrences, evaluation order, and space optimization.
Compares DFS and BFS while explaining level-order traversal, shortest paths, and multi-source BFS.
Builds a grid-DFS framework with visitation and boundary handling, then applies it to island problems.
Uses iterative inorder traversal and adjacent nodes in traversal order to solve several binary-tree problems.
Break down two challenging binary-tree problems with a three-step method: define subproblems, recurse, and combine results.
Uses binary-tree diameter to show how a global variable aggregates answers across subtrees during recursion.