← 返回资讯屏轩教育 · 行业资讯

Year 13 WJEC Computer Science: Mock Paper Analysis for Units 3 & 4 | 单元测试模拟卷解析

2026-07-23 03:11 · 本文部分内容由AI辅助创作

📚 Year 13 WJEC Computer Science: Mock Paper Analysis for Units 3 & 4 | 单元测试模拟卷解析

This article provides a detailed walkthrough of a mock examination paper designed to mirror the Year 13 WJEC Computer Science assessment for Units 3 and 4. By deconstructing typical questions on algorithm analysis, data structures, object-oriented design, databases, networking, Boolean logic, processor architecture, and operating systems, we highlight the reasoning required to achieve top marks. Each section pairs an English explanation with a Chinese translation to support bilingual learners and clarify key A-level concepts.

本文详细解析一套模拟试卷,该试卷旨在反映 Year 13 WJEC 计算机科学单元 3 和 4 的考核内容。通过拆解算法分析、数据结构、面向对象设计、数据库、网络、布尔逻辑、处理器架构和操作系统等典型题目,我们揭示获得高分所需的推理过程。每个小节均提供中英文双语解释,帮助双语学习者吃透 A-level 核心概念。

1. Algorithm Complexity & Big-O Notation | 算法复杂度与大O符号

A classic mock question presents a nested loop where the inner loop executes n times for each of the n outer iterations. The correct worst-case time complexity is O(n²), not O(2n) or O(n). Quadratic growth describes algorithms such as bubble sort and insertion sort in their average case. A follow‑up often asks to compare this with merge sort, which exhibits O(n log n) complexity. The logarithmic factor arises from repeatedly dividing the problem size, making merge sort significantly faster on large data sets.

经典模拟题给出一个嵌套循环:内层循环在外层循环的每次迭代中执行 n 次。正确的最坏情况时间复杂度是 O(n²),而非 O(2n) 或 O(n)。二次增长描述了冒泡排序、插入排序等算法的平均情况。后续题目通常要求将其与归并排序比较——归并排序复杂度为 O(n log n)。对数因子源于反复将问题规模减半,使得归并排序在大数据集上明显更快。

t n (e.g., n=20 already exceeds a million operations), whereas a quadratic algorithm with n=1000 completes about 10⁶ steps, which is manageable. Grasping these growth rates is essential for algorithm selection and justifying efficiency in the written paper.

学生在预测执行时间时常混淆 O(n²) 与 O(2ⁿ)。指数时间 O(2ⁿ) 即便在较小的 n 下也变得不可用(例如 n=20 已超过百万次运算),而 n=1000 的二次算法约执行 10⁶ 步,仍可接受。掌握这些增长率对于在笔试中选择算法并论证效率至关重要。


2. Recursive Algorithms & Stack Usage | 递归算法与栈的使用

ion pushes its return address and local parameters. For factorial(4), the stack grows: factorial(4) → factorial(3) → factorial(2) → factorial(1). Once the base case (n = 1) is reached, the stack unwinds, multiplying the returned values. The explanation should underscore that recursion relies implicitly on the system stack, and infinite recursion leads to a stack overflow error.

典型题目要求跟踪计算整数阶乘的递归函数。考生需展示调用栈,其中每次调用压入返回地址和局部参数。对于 factorial(4),栈的增长为 factorial(4) → factorial(3) → factorial(2) → factorial(1)。到达基准情况 (n = 1) 后,栈展开并将返回值相乘。解答应强调递归隐式依赖系统栈,无限递归会导致栈溢出错误。

When comparing recursion with iteration for tasks like computing Fibonacci numbers, the mock answer expects a discussion of trade‑offs. Recursive solutions often mirror mathematical definitions elegantly but incur extra overhead from repeated function calls and may suffer from exponential complexity if not memoised. Iterative versions use loops and temporary variables, generally offering better memory efficiency and avoiding call‑stack limits.

在比较递归与迭代解决斐波那契数列等问题时,模拟答案要求权衡讨论。递归方案通常优雅地映射数学定义,但会因重复函数调用产生额外开销,若不使用记忆化还可能具有指数复杂度。迭代版本使用循环和临时变量,通常内存效率更高且能避免调用栈限制。


3. Abstract Data Types: Stacks, Queues & Trees | 抽象数据类型:栈、队列与树

Questions on stacks and queues often situate them in real‑world contexts such as the undo operation in a text editor (stack) or a printer spooler (queue). Candidates should define stack operations (push, pop, peek) with LIFO behaviour and queue operations (enqueue, dequeue) with FIFO behaviour. A well‑analysed response also mentions that these ADTs can be implemented using arrays or linked lists, outlining the time trade‑offs for insertion and deletion at different ends.

有关栈和队列的题目常将它们置于真实场景中,例如文本编辑器的撤销操作(栈)或打印机后台处理程序(队列)。考生应定义栈操作(push, pop, peek)为后进先出,队列操作(enqueue, dequeue)为先进先出。完善的分析还应提及这些 ADT 可使用数组或链表实现,并简述在两端插入、删除时的时间权衡。

Tree‑based ADTs, particularly binary search trees (BSTs), appear in questions asking to insert a sequence of values and draw the resulting tree. If the input is sorted, a naive BST degenerates into a linked list, making search O(n). This motivates the introduction of balanced trees like AVL or red‑black trees, which maintain a height of O(log n). The mock solution requires explaining rotation operations used to rebalance an AVL tree after insertion.

基于树的 ADT,尤其是二叉搜索树 (BST),常在题目中要求插入一组值并绘出结果树。若输入已排序,朴素 BST 会退化为链表,导致查找复杂度为 O(n)。这引出了平衡树,如 AVL 树或红黑树,它们保持树高 O(log n)。模拟答案要求解释插入后用于重新平衡 AVL 树的旋转操作。


4. Object-Oriented Programming: Inheritance & Polymorphism | 面向对象编程:继承与多态

A mock paper scenario provides a base class Vehicle with attributes speed and fuelLevel, and derived classes Car and Motorcycle. The analysis must show how inheritance allows the subclasses to reuse the base class fields and methods while adding specialised features such as numberOfDoors for Car. The keyword extends (Java) or the colon syntax (C#/Python) correctly establishes the “is‑a” relationship, which should be distinguished from composition (“has‑a”).

模拟试卷给出一个基类 Vehicle,具有 speed 和 fuelLevel 属性,以及派生类 Car 和 Motorcycle。解析必须展示继承如何让子类复用基类的字段和方法,同时添加特定功能,如 Car 的 numberOfDoors。extends(Java)或冒号语法(C#/Python)正确建立了“is‑a”关系,应将其与组合(“has‑a”)区分开。

Polymorphism is tested with a method drive() that is overridden in each subclass to produce different behaviour. A reference variable of type Vehicle pointing to a Car object invokes Car’s drive() at runtime – this dynamic binding is central to OOP flexibility. The exam commentary highlights that this enables writing generic code, e.g., storing a collection of Vehicle objects and iterating through them without knowing the exact subtype.

多态性通过 drive() 方法考查,该方法在每个子类中被重写以产生不同行为。Vehicle 类型的引用变量指向 Car 对象时,运行时调用的是 Car 的 drive()——这种动态绑定是 OOP 灵活性的核心。试卷点评强调,这能编写泛化代码,例如存储 Vehicle 对象集合并遍历,无需知道确切子类型。


5. Database Normalisation (1NF to 3NF) | 数据库规范化 (1NF 到 3NF)

A familiar exam task supplies an unnormalised table of student exam entries with repeating groups. The candidate must convert it to first normal form by removing repeating groups and ensuring atomic values. For example, a column storing multiple subject codes should be split into separate rows. The key point is that 1NF forbids multi‑valued attributes and requires a primary key to be identified.

常见的考试任务给出一个包含重复组的学生考试未规范化表。考生必须通过移除重复组并确保原子值将其转换为第一范式。例如,存储多个科目代码的列应拆分为独立行。关键在于 1NF 禁止多值属性,并要求标识主键。

Subsequent steps move through 2NF and 3NF by eliminating partial and transitive dependencies. A partial dependency exists when a non‑key attribute depends on only part of a composite primary key; removing it creates a new table. Transitive dependency occurs when a non‑key attribute depends on another non‑key attribute. The final 3NF design typically decomposes the original table into three or more relations, which are demonstrated with relational schemas and foreign‑key links in the mark scheme.

后续步骤通过消除部分依赖和传递依赖推进到 2NF 和 3NF。当非键属性仅依赖于复合主键的一部分时存在部分依赖,移除后创建新表。传递依赖发生在一个非键属性依赖于另一个非键属性的情况下。最终 3NF 设计通常将原表分解为三个或更多关系,评分方案中以关系模式和外键链接展示。


广告 / Sponsored

6. Network Protocols & the TCP/IP Stack | 网络协议与TCP/IP协议栈

Questions on networking require candidates to map functionalities to the layers of the TCP/IP model: Application, Transport, Internet, and Network Access. For instance, HTTP and FTP operate at the Application layer, TCP at the Transport layer ensures reliable delivery via acknowledgements and sequence numbers, while IP at the Internet layer handles logical addressing and routing. Examiners expect precise protocol‑layer associations and an explanation of encapsulation – data moves down the stack with headers added at each layer.

网络相关题目要求考生将功能映射到 TCP/IP 模型的各层:应用层、传输层、互联网层和网络接入层。例如,HTTP 和 FTP 工作在应用层,传输层的 TCP 通过确认和序列号保证可靠交付,而互联网层的 IP 处理逻辑寻址和路由。考官期望精确的协议与层对应关系,并解释封装——数据沿栈向下传递,每层添加报头。

The mock paper often includes a comparison of TCP and UDP. TCP is connection‑oriented, offers flow control and error recovery, suitable for web pages and file transfer. UDP is connectionless, with lower overhead, ideal for live streaming and DNS queries where speed matters more than perfect reliability. A full‑mark answer describes scenarios where UDP’s simplicity is an advantage, such as online gaming or VoIP, and notes the use of port numbers to distinguish applications.

模拟试卷常包含 TCP 与 UDP 的比较。TCP 是面向连接的,提供流量控制和错误恢复,适合网页和文件传输。UDP 是无连接的,开销更低,适用于速度比完美可靠性更重要的实时流媒体和 DNS 查询。满分答案应描述 UDP 简单性占优的场景,如在线游戏或 VoIP,并提及使用端口号区分应用程序。


7. Boolean Algebra & Karnaugh Maps | 布尔代数与卡诺图

A typical simplification task presents a Boolean expression such as (A ∧ B) ∨ (A ∧ ¬B). Via the distributive law, this reduces to A ∧ (B ∨ ¬B) = A ∧ like complement, identity, and absorption. The mock solution uses the notation A · B + A · ¬ lication of A + A = A and A + 0 = A in more complex expressions involving three variables.

典型化简题给出布尔表达式,如 (A ∧ B) ∨ (A ∧ ¬B)。运用分配律,它可化简为 A ∧ (B ∨ ¬B) = A ∧ 1 = A。考生须用补余律、同一律、吸收律等恒等式逐步说明。模拟答案使用符号 A · B + A · ¬B = A。对于涉及三个变量的更复杂表达式,展示应用 A + A = A 和 A + 0 = A 的过程可获得分数。

e expression involves four variables, candidates are directed to use a Karnaugh map. The K‑map groups adjacent cells containing 1s in powers of two to obtain minimal sum‑of‑ An example map for F(A,B,C,D) = Σ(0,1,2,4,5,6,8,9,12,13,14) yields the simplified form A · ¬C + ¬B · ¬D + C · ¬D. Common pitfalls include failing to wrap around the map edges and overlooking “don’t care” conditions when provided.

当表达式涉及四个变量时,考生应使用卡诺图。卡诺图将相邻的 1 方框以 2 的幂次分组,得到最简与或式。例如,函数 F(A,B,C,D) = Σ(0,1,2,4,5,6,8,9,12,13,14) 化简为 A · ¬C + ¬B · ¬D + C · ¬D。常见错误包括未利用卡诺图边缘环绕,以及忽略题目给出的“无关”条件。


8. Processor Architecture: Fetch-Decode-Execute Cycle | 处理器架构:取指-译码-执行周期

The fetch‑decode‑execute cycle remains a staple of the WJEC Unit 4 paper. Candidates must describe how the Program Counter (PC) holds the address of the next instruction, which is copied to the Memory Address Register (MAR). The instruction is fetched into the Memory Data Register (MDR) and then transferred to the Current Instruction Register (CIR). The control unit decodes the opcode and dispatches signals to the ALU or other components. The PC increments, and the cycle repeats.

取指-译码-执行周期一直是 WJEC 单元 4 试卷的核心。考生须描述程序计数器 (PC) 持有下一条指令的地址,它被复制到存储器地址寄存器 (MAR)。指令取入存储器数据寄存器 (MDR),再传送到当前指令寄存器 (CIR)。控制单元译码操作码,并向 ALU 或其他部件发送信号。PC 递增,循环重复。

A higher‑mark question asks to explain how pipelining improves processor performance. By overlapping the fetch, decode, and execute stages for successive instructions, the processor can work on several instructions simultaneously, improving throughput. The analysis should note that structural hazards (resource conflicts), data hazards (dependencies), and control hazards (branches) can stall the pipeline, and techniques like forwarding and branch prediction mitigate these. A quantitative example comparing cycles with and without pipelining strengthens the answer.

高分题目要求解释流水线如何提升处理器性能。通过重叠连续指令的取指、译码和执行阶段,处理器可同时处理多条指令,提升吞吐量。分析应指出,结构冒险(资源冲突)、数据冒险(依赖关系)和控制冒险(分支)可能导致流水线停顿,而转发和分支预测等技术可以缓解。给出有无流水线的周期数对比能增强答案。


9. Assembly Language Addressing Modes | 汇编语言寻址方式

In a typical question, students are given a short assembly program using mnemonics like LDA, STA, ADD, and SUB alongside different addressing modes. Immediate addressing uses a literal value directly in the instruction (e.g., LDA #5). Direct addressing specifies the absolute memory address of the operand (LDA 200). Indexed addressing adds the content of an index register to a base address to form the effective address, essential for array traversal. Distinguishing these modes prevents operand misinterpretation.

在典型题目中,考生会看到使用 LDA、STA、ADD、SUB 等助记符并附带不同寻址方式的简短汇编程序。立即寻址在指令中直接使用字面值(如 LDA #5)。直接寻址指定操作数的绝对内存地址(LDA 200)。变址寻址将变址寄存器的内容与基地址相加得到有效地址,这对数组遍历至关重要。区分这些方式可避免错误解读操作数。

The trace exercise requires stepping through the code, recording the values in the accumulator, index register, and status flags (zero, negative, carry). Understanding how flags are set after arithmetic or logical operations is often tested. For instance, after a subtraction that yields zero, the zero flag is set, influencing conditional branch instructions like BEQ or BNE. The mark scheme expects precise flag‑state documentation in a trace table.

跟踪练习要求单步执行代码,记录累加器、变址寄存器和状态标志(零、负、进位)的值。理解算术或逻辑运算后标志的设置方式常受考查。例如,减法结果为零后,零标志被置位,进而影响条件分支指令如 BEQ 或 BNE。评分方案期望在跟踪表中准确记录标志状态。


10. Operating System Scheduling Algorithms | 操作系统调度算法

A scenario‑based question provides a list of processes with arrival times and burst durations, asking to compute average waiting time and turnaround time under Round Robin (RR), Shortest Job First (SJF), and First Come First Served (FCFS). For RR with a time quantum of 4 ms, the Gantt chart is filled, and calculations show that RR improves response time but may increase overhead due to context switching. The analysis must highlight that SJF is optimal in terms of average waiting time but requires knowledge of future burst lengths.

基于场景的题目给出一个带有到达时间和突发时长的进程列表,要求计算轮转调度(RR)、最短作业优先(SJF)和先来先服务(FCFS)下的平均等待时间和周转时间。在时间片为 4 ms 的 RR 中,绘制甘特图并计算显示 RR 改善了响应时间,但可能因上下文切换增加开销。分析须强调 SJF 在平均等待时间上是最优的,但需要预知未来的突发长度。

The discussion part of the question asks to evaluate scheduling algorithms for a real‑time system. Critical processes must meet deadlines, so preemptive priority‑based scheduling with ageing is often recommended. FCFS would be unsuitable because it might delay a high‑priority task indefinitely. The models of multi‑level feedback queues combine the strengths of several algorithms by moving CPU‑bound processes to lower‑priority queues and allowing I/O‑bound processes to stay responsive, a concept often rewarded in holistic answers.

题目的讨论部分要求评估适用于实时系统的调度算法。关键进程必须满足截止时间,因此常推荐采用可抢占的优先级调度并辅以老化机制。FCFS 不适合,因为它可能无限期地延迟高优先级任务。多级反馈队列模型结合多种算法的优点,将 CPU 密集型进程移入低优先级队列,同时允许 I/O 密集型进程保持响应,这一概念在全盘答案中常获加分。


Published by TutorHao | Computer Science Revision Series | aleveler.com

广告 / Sponsored
Linux高级程序设计(高等院校计算机技术十二五规划教材)/刘加海/季江民/浙江大学出版社
计算机 备考教辅 · 正版现货 · 与本文内容相关
查看详情 / View on Taobao参考价 ¥55.6

更多咨询请联系16621398022(同微信)

备考资讯每日更新,关注不错过
考纲变化 · 科目分析 · 学习方法
扫码关注公众号 tutorhao
在微信里长按二维码识别关注
或截图后用「扫一扫 → 相册」选择本图
公众号:tutorhao