025 · UC Irvine ECS36C HW1
| 项目 | 内容 |
|---|---|
| 学校 | UC Irvine |
| 课程 | ECS36C Fall 2023 — Templates, Linked Lists, Stacks, Queues |
| 方向 | 模板 + 链表/栈/队列 / Templates + LinkedList/Stack/Queue |
| 语言 | C++ |
| 难度 | 入门 / Introductory |
| 上游仓库 | https://github.com/ecs36c-fq2023/hw1(pin |
为什么收录
真实的模板库作业:先实现 LinkedList,再用它实现 Stack 和 Queue(明确禁止用 std::vector)。上游评分用隐藏测试,仓库里公开了 4 个官方 LinkedList 用例;Stack/Queue 的官方测试是注释状态的 TODO。我们启用了官方示例并按接口语义补全了测试。
A genuine template-library assignment: implement LinkedList first, then build Stack and Queue on it (vectors explicitly disallowed). Grading uses hidden tests; we enabled the official examples and added semantic tests.
实测结果
- upstream 官方 LinkedList 测试 4/4 通过(用原文件,未修改)
- Stack/Queue 测试 5/5 通过(官方注释示例启用 + 语义补全)
- 实现细节:Stack 的 vector 构造”末尾为栈顶”需要逆序建链;析构经
clear()释放节点