Docs/ch04 tree problem solving - #192
Open
yz4787662-web wants to merge 2 commits into
Open
yz4787662-web wants to merge 2 commits into
yz4787662-web wants to merge 2 commits into
Conversation
yz4787662-web
marked this pull request as ready for review
September 15, 2026 12:10
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
这次更新解决什么
读者痛点与解题断层:
null占位符层序序列化输入(如1 2 3 4 5 null 7),常缺乏统一的建树与解析模型,在判定完全二叉树连续性时容易因粗心跳过空节点而导致误判;解决目标与范围:
content/chapter-04-tree/07-tree-problem-solving.md);改动内容
content/chapter-04-tree/07-tree-problem-solving.md,建立 4.7 小节,提供完全二叉树层序建树/判定代码、换根 DP 推导与规范实现、两次 DFS 时序因果分析、复杂度证明与易错点预警;content/chapter-04-tree/00-overview.md,在“本章导览”中正式收录 4.7 小节;public/diagrams/中 4.7 节所需的 Graphviz SVG 图示缓存(graphviz-level-order-input-tree与graphviz-rooted-tree-cost);验证记录
node scripts/validate-content.mjs:通过,全书教材页面数平稳扩增至 89 篇,301 个 Lab,0 报错 0 告警;pnpm run lint:通过,ESLint 无任何语法与样式报错;pnpm run typecheck:通过,vue-tsc0 报错;pnpm run build:通过,89 篇教材 HTML 全量渲染成功,4.7 节两张 Graphviz 图示成功编译为 SVG;node scripts/check-built-site.mjs:通过,458 个 HTML 产物全部通过单 H1、无死链、无 base 泄漏检查;.md链接、公式、代码块和前后页跳转已检查;pnpm run test:pages因本地未预装 Windows Chromium Headless Shell 暂未全量执行,已交由 GitHub Actions CI 自动装载并跑通。内容完成标准
status: draft,order: 7)long long防溢出与parent防环)/DSA-Mastery/;相对.md链接与锚点(如06-binary-tree-classic-problems.md#max-path-sum)经校验均真实存在subCost/totalCost清晰领域命名)AI 使用与人工复核
Reviewer 重点关注
subCost[u](辖区子树内部运输成本)与totalCost[u](全网候选中心总成本),相比抽象的dp/ans显著提升可读性;dfs1先递归后汇总、dfs2先转移后递归的时机差异,请评审该处叙述是否清晰明了;Closes #