feat(labs): ch8/ch9 新增 15 道公开题库改编编程题 - #185
Merged
Merged
Conversation
ch8 查找 4→12:折半首现/首末位置/数对计数(改编洛谷 P2249、P1102、 LeetCode 34)、判定树构造与 BST 校验/LCA(LeetCode 108/98/235)、 平衡判断与手写 AVL 模板(LeetCode 110、洛谷 P3369)。 ch9 散列与索引 3→10:去重保首次、点名状态机、学生信息查询 (洛谷 P4305、P2580、牛客 KY53 王道机试)、线性探测哈希映射与 链地址哈希集合(LeetCode 706/705,墓碑删除与冲突对照)、字符串 哈希计数(P3370)、最长连续序列(LeetCode 128)。 全部题目改编自公开题库,按课程 stdio 协议重述并独立编写参考实现 与测试;15 题 validate/verify 全过(solution=100、starter 可编译 非满分、oracle 无漂移);教材文章配套 Lab 清单同步更新。
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.
概要
为第 8 章(查找)与第 9 章(散列与索引)各补齐一批 Program 型 Lab,题目量级对齐其他章节(ch8:4→12;ch9:3→10),全部改编自公开题库(洛谷 / LeetCode / 牛客),按课程 stdio 协议重述题面、独立编写参考实现与测试,不复制来源站点代码或隐藏数据。
ch8 查找(+8)
ch9 散列与索引(+7)
配套改动:ch8 三篇文章与 00-overview、ch9 散列文章的"配套理论题与 Lab / 配套 Labs"清单同步加入链接。9.1 B 树部分公开 OJ 无合适完整实现题(已检索确认),编程覆盖维持 ch5 E-05-26/27 与 P-09-01 现状,未强行自拟。
验证证据(按 Lab 指南 §10)
lab:validate与lab:verify均通过:solution=100、student 编译可过且非满分(0~55 分不等)、expectedStable/oracle 无漂移;每题 6~7 个用例、分值合计 100,覆盖 sample/normal/boundary/stress(固定种子生成,单文件 ≤ 3MB,未超仓库既有压力数据惯例)pnpm run validate(content + typecheck + lint)、test:tree-demos、test:bootstrap、test:lab-docs、test:discovery、vitepress build、check:site(475 页 HTML、319 个 Lab、无死链)全部通过未执行项与原因
tests/lab-tools.test.mjs中 1 个用例("single stdio case feedback cannot replace a full Task grade…",期望 45 得 0)在 main 干净 worktree 上同样失败,属既有环境问题,与本次改动无关;链条中位于该测试之后的步骤(lab-docs / discovery / build / check:site)已单独补跑通过test:pages(Playwright)未跑:本次不涉及侧栏范围、样式或 Pages base 变更lab:pack学生包抽查未做,可在 Review 阶段补Review 提示
cd labs/chapter-08/exercise/E-08-09-balanced-tree-template && make doctor && make run && make score,或仓库根pnpm lab:verify -- <lab路径>